[PATCH] bio clone memory corruption
Doing some raid testing threw a bug in the scsi mid layer, because the segment counts wasn't correct. Initially I worried that we still had problems in this area, but it turns out that is due to the raid usage of bio clones. Currently you have to hold on to the original bio as well, since the clone only maintains a pointer to the bio_vec inside the original bio. If the original bio is freed first, the clone will have garbage in its bio->bi_io_vec as soon as that memory is scribbled. I think the best fix is to maintain flexibility and duplicate the io_vec inside the clone as well. Attached patch does this. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment