All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Nate Dailey <nate.dailey@stratus.com>, linux-raid@vger.kernel.org
Cc: Jes.Sorensen@redhat.com
Subject: Re: [PATCH] drivers/md/md.c: ignore recovery_offset if bitmap exists
Date: Sat, 31 Oct 2015 11:26:36 +1100	[thread overview]
Message-ID: <87y4ejvq6b.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <563370F8.3070100@stratus.com>

[-- Attachment #1: Type: text/plain, Size: 2611 bytes --]

On Sat, Oct 31 2015, Nate Dailey wrote:

> I first tested 4.3-rc6 that I already had laying around, and verified that the 
> bug still happens.
>
> Then I reverted 7eb418851f3278de67126ea0c427641ab4792c57, rebuilt & installed, 
> and tested again. Reverting this patch did indeed fix the bug.
>
> Thank you!
>
> Nate
>

Thanks a lot for testing.
The following with go to Linus soon, hopefully in time for 4.3-final.
It should then be picked up by stable.

If anyone wants to try their hand at the "future patch" I mentioned, I
wouldn't object. MD_FEATURE_RECOVERY_BITMAP is an important part of the
picture.  I won't have an opportunity to work on it until December.

Thanks,
NeilBrown


commit d01552a76d71f9879af448e9142389ee9be6e95b
Author: NeilBrown <neilb@suse.com>
Date:   Sat Oct 31 11:00:56 2015 +1100

    Revert "md: allow a partially recovered device to be hot-added to an array."
    
    This reverts commit 7eb418851f3278de67126ea0c427641ab4792c57.
    
    This commit is poorly justified, I can find not discusison in email,
    and it clearly causes a problem.
    
    If a device which is being recovered fails and is subsequently
    re-added to an array, there could easily have been changes to the
    array *before* the point where the recovery was up to.  So the
    recovery must start again from the beginning.
    
    If a spare is being recovered and fails, then when it is re-added we
    really should do a bitmap-based recovery up to the recovery-offset,
    and then a full recovery from there.  Before this reversion, we only
    did the "full recovery from there" which is not corect.  After this
    reversion with will do a full recovery from the start, which is safer
    but not ideal.
    
    It will be left to a future patch to arrange the two different styles
    of recovery.
    
    Reported-and-tested-by: Nate Dailey <nate.dailey@stratus.com>
    Signed-off-by: NeilBrown <neilb@suse.com>
    Cc: stable@vger.kernel.org (3.14+)
    Fixes: 7eb418851f32 ("md: allow a partially recovered device to be hot-added to an array.")

diff --git a/drivers/md/md.c b/drivers/md/md.c
index c702de18207a..3fe3d04a968a 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8040,8 +8040,7 @@ static int remove_and_add_spares(struct mddev *mddev,
 		       !test_bit(Bitmap_sync, &rdev->flags)))
 			continue;
 
-		if (rdev->saved_raid_disk < 0)
-			rdev->recovery_offset = 0;
+		rdev->recovery_offset = 0;
 		if (mddev->pers->
 		    hot_add_disk(mddev, rdev) == 0) {
 			if (sysfs_link_rdev(mddev, rdev))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

      reply	other threads:[~2015-10-31  0:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 19:28 [PATCH] drivers/md/md.c: ignore recovery_offset if bitmap exists Nate Dailey
2015-07-29 20:46 ` Joe Lawrence
2015-08-14 14:58   ` Nate Dailey
2015-10-30  2:51     ` Neil Brown
2015-10-30 13:30       ` Nate Dailey
2015-10-31  0:26         ` Neil Brown [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=87y4ejvq6b.fsf@notabene.neil.brown.name \
    --to=neilb@suse.de \
    --cc=Jes.Sorensen@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.