aboutsummaryrefslogtreecommitdiff
path: root/fs/bio.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-05-22 22:35:26 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-23 10:35:31 -0700
commit5c4c33318d26620fa552f15bbb6d0f9775a1b4df (patch)
treed1d39bca5beb51dfcbb47d4b0c47a56214d4448b /fs/bio.c
parentf2d395865faa2a7cd4620b07178e58cbb160ba08 (diff)
[PATCH] md: fix possible oops when starting a raid0 array
This loop that sets up the hash_table has problems. Careful examination will show that the last time through, everything but the first line is pointless. This is because all it does is change 'cur' and 'size' and neither of these are used after the loop. This should ring warning bells... That last time through the loop, size += conf->strip_zone[cur].size can index off the end of the strip_zone array. Depending on what it finds there, it might exit the loop cleanly, or it might spin going further and further beyond the array until it hits an unmapped address. This patch rearranges the code so that the last, pointless, iteration of the loop never happens. i.e. the one statement of the last loop that is needed is moved the the end of the previous loop - or to before the loop starts - and the loop counter starts from 1 instead of 0. Cc: "Don Dupuis" <dondster@gmail.com> Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/bio.c')
0 files changed, 0 insertions, 0 deletions