1
linux/drivers/block
Tejun Heo ba02508248 [PATCH] blk: fix tag shrinking (revive real_max_size)
My patch in commit fa72b903f7 incorrectly
removed blk_queue_tag->real_max_depth.

The original resize implementation was incorrect in the following
points.

 * actual allocation size of tag_index was shorter than real_max_size,
   but assumed to be of the same size, possibly causing memory access
   beyond the allocated area.
 * bits in tag_map between max_deptn and real_max_depth were
   initialized to 1's, making the tags permanently reserved.

In an attempt to fix above two bugs, I had removed allocation optimization
in init_tag_map and real_max_size.  Tag map/index were allocated and freed
immediately during resize.

Unfortunately, I wasn't considering that tag map/index can be resized
dynamically with tags beyond new_depth active.  This led to accessing
freed area after shrinking tags and led to the following bug reporting
thread on linux-scsi.

   http://marc.theaimsgroup.com/?l=linux-scsi&m=112319898111885&w=2

To fix the problem, I've revived real_max_depth without allocation
optimization in init_tag_map, and Andrew Vasquez confirmed that the
problem was fixed.  As Jens is not going to be available for a week, he
asked me to make sure that this patch reaches you.

   http://marc.theaimsgroup.com/?l=linux-scsi&m=112325778530886&w=2

Also, a comment was added to make sure that real_max_size is needed for
dynamic shrinking.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-08-05 13:43:16 -07:00
..
aoe
paride
acsi_slm.c
acsi.c
amiflop.c
as-iosched.c [PATCH] as-iosched tunable encoding fix 2005-07-27 16:25:50 -07:00
ataflop.c
cciss_cmd.h
cciss_scsi.c
cciss_scsi.h
cciss.c [PATCH] cciss per disk queue 2005-07-28 08:39:01 -07:00
cciss.h [PATCH] cciss per disk queue 2005-07-28 08:39:01 -07:00
cfq-iosched.c [PATCH] cfq-iosched: fix problem with barriers and max_depth == 1 2005-08-02 11:19:18 -07:00
cpqarray.c
cpqarray.h
cryptoloop.c
DAC960.c
DAC960.h
deadline-iosched.c [PATCH] Update cfq io scheduler to time sliced design 2005-06-27 14:33:29 -07:00
elevator.c [PATCH] Update cfq io scheduler to time sliced design 2005-06-27 14:33:29 -07:00
floppy.c
genhd.c
ida_cmd.h
ida_ioctl.h
ioctl.c [PATCH] block: add unlocked_ioctl support for block devices 2005-06-23 09:45:32 -07:00
Kconfig
Kconfig.iosched
ll_rw_blk.c [PATCH] blk: fix tag shrinking (revive real_max_size) 2005-08-05 13:43:16 -07:00
loop.c
Makefile
nbd.c
noop-iosched.c
pktcdvd.c [PATCH] Cleanup patch for process freezing 2005-06-25 17:10:13 -07:00
ps2esdi.c
rd.c
scsi_ioctl.c
smart1,2.h
swim3.c [PATCH] ppc32: Remove CONFIG_PMAC_PBOOK 2005-06-27 15:11:43 -07:00
swim_iop.c
sx8.c [PATCH] turn many #if $undefined_string into #ifdef $undefined_string 2005-07-27 16:26:08 -07:00
ub.c [PATCH] ub: fix for blank CDs 2005-07-27 16:25:52 -07:00
umem.c
viodasd.c
xd.c
xd.h
z2ram.c