From: NeilBrown <neilb@suse.de>
To: Nate Dailey <nate.dailey@stratus.com>
Cc: linux-raid@vger.kernel.org,
Jonathan Brassow <jbrassow@redhat.com>,
device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH] dm-raid: check events in super_validate
Date: Tue, 25 Feb 2014 16:30:20 +1100 [thread overview]
Message-ID: <20140225163020.6f299f15@notabene.brown> (raw)
In-Reply-To: <52ED0628.4030203@stratus.com>
[-- Attachment #1: Type: text/plain, Size: 2475 bytes --]
On Sat, 1 Feb 2014 09:35:20 -0500 Nate Dailey <nate.dailey@stratus.com> wrote:
> If an LVM raid1 recovery is interrupted by deactivating the LV, when the
> LV is reactivated it comes up with both members in sync--the recovery
> never completes.
>
> I've been trying to figure out how to fix this. Does this approach look
> okay? I'm not sure what else to use to determine that a member disk is
> out of sync. It looks like if disk_recovery_offset in the superblock
> were updated during the recovery, that would also cause it to resume
> after interruption--but MD skips the recovery target disk when writing
> superblocks, so this doesn't work.
>
> Comments?
I know it is confusing, but this should really have gone to dm-devel rather
than linux-raid, to make sure Jon Brassow see it (hi Jon!).
Setting recovery_offset to 0 certainly looks wrong, it should be set to
sb->disk_recovery_offset
like the code just above your change.
Why does the code there not meet your need.
Jon: can you help?
NeilBrown
>
> Thanks,
>
> Nate Dailey
> Stratus Technologies
>
>
>
> diff -Nupr linux-3.12.9.orig/drivers/md/dm-raid.c
> linux-3.12.9/drivers/md/dm-raid.c
> --- linux-3.12.9.orig/drivers/md/dm-raid.c 2014-02-01
> 08:46:51.088086299 -0500
> +++ linux-3.12.9/drivers/md/dm-raid.c 2014-02-01 09:02:06.657149550 -0500
> @@ -1042,6 +1042,21 @@ static int super_validate(struct mddev *
> rdev->recovery_offset = le64_to_cpu(sb->disk_recovery_offset);
> if (rdev->recovery_offset != MaxSector)
> clear_bit(In_sync, &rdev->flags);
> + else if (!test_bit(Faulty, &rdev->flags)) {
> + uint64_t events_sb;
> +
> + /*
> + * Trigger recovery if events is out-of-date.
> + */
> + events_sb = le64_to_cpu(sb->events);
> + if (events_sb < mddev->events) {
> + DMINFO("Force recovery on out-of-date device #%d.",
> + rdev->raid_disk);
> + clear_bit(In_sync, &rdev->flags);
> + rdev->saved_raid_disk = rdev->raid_disk;
> + rdev->recovery_offset = 0;
> + }
> + }
> }
>
> /*
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2014-02-25 5:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-01 14:35 [PATCH] dm-raid: check events in super_validate Nate Dailey
2014-02-25 5:30 ` NeilBrown [this message]
2014-02-25 22:13 ` Brassow Jonathan
2014-02-25 22:22 ` Nate Dailey
2014-02-25 22:59 ` Brassow Jonathan
2014-02-26 22:21 ` [dm-devel] " Brassow Jonathan
2014-02-27 0:17 ` Nate Dailey
2014-02-28 20:40 ` Brassow Jonathan
2014-03-01 13:54 ` Brassow Jonathan
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=20140225163020.6f299f15@notabene.brown \
--to=neilb@suse.de \
--cc=dm-devel@redhat.com \
--cc=jbrassow@redhat.com \
--cc=linux-raid@vger.kernel.org \
--cc=nate.dailey@stratus.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).