From: Felix Bellaby <member@bellaby.freeserve.co.uk>
To: Neil Brown <neilb@cse.unsw.edu.au>
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: RAID10 overwrites partition tables
Date: Sat, 27 Nov 2004 19:12:48 +0100 (CET) [thread overview]
Message-ID: <4040305.1101579168561.JavaMail.www@wwinf3001> (raw)
On Friday November 27, Neil Brown wrote
>> mdadm --level 10 does not seem to respect disk partition boundaries.
>
> Hmmm, yes, thanks.
>
> I think the following should fix the bug. It only affects 'resync'
> not normal IO or recovery (after a drive has failed).
> ...
> diff ./drivers/md/raid10.c~current~ ./drivers/md/raid10.c
> --- ./drivers/md/raid10.c~current~ 2004-11-16 16:33:50.000000000 +1100
> +++ ./drivers/md/raid10.c 2004-11-27 11:00:06.000000000 +1100
> @@ -1150,6 +1150,7 @@ static void sync_request_write(mddev_t *
> md_sync_acct(conf->mirrors[d].rdev->bdev, tbio->bi_size >> 9);
>
> tbio->bi_sector += conf->mirrors[d].rdev->data_offset;
> + tbio->bi_bdev = conf->mirrors[d].rdev->bdev;
> generic_make_request(tbio);
> }
Thanks, the adjustments to the bio before the generic_make_request do the trick
nicely.
Note that the version of raid10.c in the current Fedora 3 series does not include
either of the adjustments so the patch required against that version becomes:
diff ./drivers/md/raid10.c~ ./drivers/md/raid10.c
--- ./drivers/md/raid10.c~ 2004-11-16 16:33:50.000000000 +1100
+++ ./drivers/md/raid10.c 2004-11-27 11:00:06.000000000 +1100
@@ -1145,6 +1145,8 @@
atomic_inc(&r10_bio->remaining);
md_sync_acct(conf->mirrors[d].rdev->bdev, tbio->bi_size >> 9);
+ tbio->bi_sector += conf->mirrors[d].rdev->data_offset;
+ tbio->bi_bdev = conf->mirrors[d].rdev->bdev;
generic_make_request(tbio);
}
Thanks again,
Felix
--
Whatever you Wanadoo:
http://www.wanadoo.co.uk/time/
This email has been checked for most known viruses - find out more at: http://www.wanadoo.co.uk/help/id/7098.htm
next reply other threads:[~2004-11-27 18:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-27 18:12 Felix Bellaby [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-11-26 17:28 RAID10 overwrites partition tables Felix Bellaby
2004-11-27 0:02 ` Neil Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4040305.1101579168561.JavaMail.www@wwinf3001 \
--to=member@bellaby.freeserve.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=neilb@cse.unsw.edu.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).