From: Neil Brown <neilb@suse.de>
To: "Mike Snitzer" <snitzer@gmail.com>
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
paul.clements@steeleye.com
Subject: Re: [RFC][PATCH] md: avoid fullsync if a faulty member missed a dirty transition
Date: Thu, 8 May 2008 16:13:14 +1000 [thread overview]
Message-ID: <18466.39418.578722.92979@notabene.brown> (raw)
In-Reply-To: message from Mike Snitzer on Tuesday May 6
On Tuesday May 6, snitzer@gmail.com wrote:
>
> It looks like bitmap_update_sb()'s incrementing of events_cleared (on
> behalf of the local member) could be racing with the fact that the NBD
> member becomes faulty (whereby making the array degraded). This
> allows the events_cleared to reflect a clean->dirty transition last
> occurred before the array became degraded. My reasoning is: If it was
> a clean->dirty transition the bitmap still has the associated dirty
> bit set in the local member's bitmap, so using the bitmap to resync is
> valid.
>
> thanks,
> Mike
Thanks for persisting. I think I understand what is going on now.
How about this patch? It is similar to your, but instead of depending
on the odd/even state of the event counter, it directly checks the
clean/dirty state of the array.
NeilBrown
Signed-off-by: Neil Brown <neilb@suse.de>
### Diffstat output
./drivers/md/md.c | 5 +++++
1 file changed, 5 insertions(+)
diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c 2008-05-02 14:49:05.000000000 +1000
+++ ./drivers/md/md.c 2008-05-08 16:10:48.000000000 +1000
@@ -843,6 +843,8 @@ static int super_90_validate(mddev_t *md
/* if adding to array with a bitmap, then we can accept an
* older device ... but not too old.
*/
+ if (sb->state & (1<<MD_SB_CLEAN))
+ ev1++;
if (ev1 < mddev->bitmap->events_cleared)
return 0;
} else {
@@ -1218,6 +1220,9 @@ static int super_1_validate(mddev_t *mdd
/* If adding to array with a bitmap, then we can accept an
* older device, but not too old.
*/
+ if (mddev->recovery_cp == MaxSector)
+ /* array was clean, so can allow 'next' event */
+ ev1++;
if (ev1 < mddev->bitmap->events_cleared)
return 0;
} else {
next prev parent reply other threads:[~2008-05-08 6:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-02 22:09 Mike Snitzer
2008-05-06 6:53 ` Neil Brown
2008-05-06 11:58 ` Mike Snitzer
2008-05-08 6:13 ` Neil Brown [this message]
2008-05-08 20:11 ` Mike Snitzer
2008-05-09 1:40 ` Neil Brown
2008-05-09 4:42 ` Mike Snitzer
2008-05-09 5:08 ` Mike Snitzer
2008-05-09 5:26 ` Mike Snitzer
2008-05-09 6:01 ` Neil Brown
2008-05-09 15:00 ` Mike Snitzer
2008-05-16 11:54 ` Neil Brown
2008-05-19 4:33 ` Mike Snitzer
2008-05-19 5:27 ` Neil Brown
2008-05-20 15:30 ` Mike Snitzer
2008-05-20 15:33 ` Mike Snitzer
2008-05-27 6:56 ` Neil Brown
2008-05-27 14:33 ` Mike Snitzer
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=18466.39418.578722.92979@notabene.brown \
--to=neilb@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=paul.clements@steeleye.com \
--cc=snitzer@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
all inboxes | Powered by JetHome®