From: NeilBrown <neilb@suse.de>
To: kedacomkernel <kedacomkernel@gmail.com>
Cc: majianpeng <majianpeng@gmail.com>,
linux-raid <linux-raid@vger.kernel.org>
Subject: Re: md/raid1:If r1bio->sectors % 8 != 0,then the memcmp and latermemcpy will omit the last bio_vec.
Date: Thu, 5 Apr 2012 16:53:46 +1000 [thread overview]
Message-ID: <20120405165346.2b21bdf8@notabene.brown> (raw)
In-Reply-To: <201204051412225155656@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]
On Thu, 5 Apr 2012 14:12:25 +0800 "kedacomkernel" <kedacomkernel@gmail.com>
wrote:
> I readed your patch and found it wrong.My patch had two point
> 1:memcmp probem.You patch can correct it.
> 2:omit the last bio_vec.You patch did not correct it.
> If r1bio->sectors %8 != 0,supposed sectors = 18,then bio cover three pages.
> But:
> >>int vcnt = r1_bio->sectors >> (PAGE_SHIFT- 9); vcnt=2
> then
> >>for (j = vcnt; j-- ; )
> j = 1, 0
>
Ahhh, yes of course.
Thanks.
> > @@ -1711,7 +1711,7 @@ static int process_checks(struct r1bio *r1_bio)
> > struct mddev *mddev = r1_bio->mddev;
> > struct r1conf *conf = mddev->private;
> > int primary;
> > - int i;
> > + int i, vcnt;
> >
> > for (primary = 0; primary < conf->raid_disks * 2; primary++)
> > if (r1_bio->bios[primary]->bi_end_io == end_sync_read &&
> > @@ -1721,9 +1721,9 @@ static int process_checks(struct r1bio *r1_bio)
> > break;
> > }
> > r1_bio->read_disk = primary;
> > + vcnt = (r1_bio->sectors + PAGE_SIZE / 512 - 1) >> (PAGE_SHIFT - 9);
> > for (i = 0; i < conf->raid_disks * 2; i++) {
> > int j;
> > - int vcnt = r1_bio->sectors >> (PAGE_SHIFT- 9);
> > struct bio *pbio = r1_bio->bios[primary];
> > struct bio *sbio = r1_bio->bios[i];
> > int size;
This bit.
I'll make sure that gets applied.
Thanks,
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
prev parent reply other threads:[~2012-04-05 6:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-31 7:44 md/raid1:If r1bio->sectors % 8 != 0,then the memcmp and later memcpy will omit the last bio_vec majianpeng
2012-04-02 1:41 ` NeilBrown
2012-04-05 6:12 ` Re: md/raid1:If r1bio->sectors % 8 != 0,then the memcmp and latermemcpy " kedacomkernel
2012-04-05 6:53 ` NeilBrown [this message]
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=20120405165346.2b21bdf8@notabene.brown \
--to=neilb@suse.de \
--cc=kedacomkernel@gmail.com \
--cc=linux-raid@vger.kernel.org \
--cc=majianpeng@gmail.com \
/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).