[dm-devel] [patch 01/18] bio_clone fix

akpm at osdl.org akpm at osdl.org
Thu Jul 28 08:07:18 UTC 2005


From: Andrew Morton <akpm at osdl.org>

Fix bug introduced in 2.6.11-rc2: when we clone a BIO we need to copy over the
current index into it as well.

It corrupts data with some MD setups.

See http://bugzilla.kernel.org/show_bug.cgi?id=4946

Huuuuuuuuge thanks to Matthew Stapleton <matthew4196 at gmail.com> for doggedly
chasing this one down.

Acked-by: Jens Axboe <axboe at suse.de>
Cc: <linux-raid at vger.kernel.org>
Cc: <dm-devel at redhat.com>
Signed-off-by: Andrew Morton <akpm at osdl.org>
---

 fs/bio.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN fs/bio.c~bio_clone-fix fs/bio.c
--- devel/fs/bio.c~bio_clone-fix	2005-07-28 00:39:40.000000000 -0700
+++ devel-akpm/fs/bio.c	2005-07-28 01:02:34.000000000 -0700
@@ -261,6 +261,7 @@ inline void __bio_clone(struct bio *bio,
 	 */
 	bio->bi_vcnt = bio_src->bi_vcnt;
 	bio->bi_size = bio_src->bi_size;
+	bio->bi_idx = bio_src->bi_idx;
 	bio_phys_segments(q, bio);
 	bio_hw_segments(q, bio);
 }
_




More information about the dm-devel mailing list