linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] raid1: set bi_idx after bio cloning
@ 2005-05-13 21:39 Mike Tran
  2005-05-13 23:08 ` Neil Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Tran @ 2005-05-13 21:39 UTC (permalink / raw)
  To: neilb, axboe, linux-raid

Hi Neil et al,

The scenario:  Having LVM (striped) volumes on top of 2 raid1 devices
The problem:   Corruption in building the scatter gather list for
device driver (see /drivers/block/blk_rq_map_sg() function)

In DM code, a bio sometimes can be split into several
clones and the clones' bi_idx is set accordingly by DM.  MD raid1 also
clones bio but does not adjust bi_idx. The problem can be fixed in
either __bio_clone() or the caller of bio_clone().  I chose to fix
raid1.

--- linux-2.6.12-rc4-orig/drivers/md/raid1.c    2005-05-10 13:35:06.000000000-0500
+++ linux-2.6.12-rc4-patch/drivers/md/raid1.c   2005-05-13 15:41:43.000000000-0500
@@ -577,6 +577,7 @@

                r1_bio->bios[rdisk] = read_bio;

+               read_bio->bi_idx = bio->bi_idx;
                read_bio->bi_sector = r1_bio->sector + mirror->rdev->data_offset;
                read_bio->bi_bdev = mirror->rdev->bdev;
                read_bio->bi_end_io = raid1_end_read_request;

--
Regards,
Mike T.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-05-23  7:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-13 21:39 [PATCH] raid1: set bi_idx after bio cloning Mike Tran
2005-05-13 23:08 ` Neil Brown
2005-05-16 15:25   ` [PATCH] bio: " Mike Tran
2005-05-16 22:19     ` problems with 3ware 8506-8 post-disk failure Harry Mangalam
2005-05-23  7:31     ` [PATCH] bio: set bi_idx after bio cloning Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).