stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "raid5: Set R5_Expanded on parity devices as well as data." has been added to the 4.4-stable tree
@ 2017-12-18 13:55 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-12-18 13:55 UTC (permalink / raw)
  To: neilb, alexander.levin, gregkh, lightspd, shli; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    raid5: Set R5_Expanded on parity devices as well as data.

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     raid5-set-r5_expanded-on-parity-devices-as-well-as-data.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Mon Dec 18 14:47:43 CET 2017
From: NeilBrown <neilb@suse.com>
Date: Tue, 17 Oct 2017 16:18:36 +1100
Subject: raid5: Set R5_Expanded on parity devices as well as data.

From: NeilBrown <neilb@suse.com>


[ Upstream commit 235b6003fb28f0dd8e7ed8fbdb088bb548291766 ]

When reshaping a fully degraded raid5/raid6 to a larger
nubmer of devices, the new device(s) are not in-sync
and so that can make the newly grown stripe appear to be
"failed".
To avoid this, we set the R5_Expanded flag to say "Even though
this device is not fully in-sync, this block is safe so
don't treat the device as failed for this stripe".
This flag is set for data devices, not not for parity devices.

Consequently, if you have a RAID6 with two devices that are partly
recovered and a spare, and start a reshape to include the spare,
then when the reshape gets past the point where the recovery was
up to, it will think the stripes are failed and will get into
an infinite loop, failing to make progress.

So when contructing parity on an EXPAND_READY stripe,
set R5_Expanded.

Reported-by: Curt <lightspd@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/md/raid5.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -1681,8 +1681,11 @@ static void ops_complete_reconstruct(voi
 		struct r5dev *dev = &sh->dev[i];
 
 		if (dev->written || i == pd_idx || i == qd_idx) {
-			if (!discard && !test_bit(R5_SkipCopy, &dev->flags))
+			if (!discard && !test_bit(R5_SkipCopy, &dev->flags)) {
 				set_bit(R5_UPTODATE, &dev->flags);
+				if (test_bit(STRIPE_EXPAND_READY, &sh->state))
+					set_bit(R5_Expanded, &dev->flags);
+			}
 			if (fua)
 				set_bit(R5_WantFUA, &dev->flags);
 			if (sync)


Patches currently in stable-queue which might be from neilb@suse.com are

queue-4.4/md-cluster-free-md_cluster_info-if-node-leave-cluster.patch
queue-4.4/autofs-fix-careless-error-in-recent-commit.patch
queue-4.4/raid5-set-r5_expanded-on-parity-devices-as-well-as-data.patch
queue-4.4/nfsd-fix-nfsd_reset_versions-for-nfsv4.patch
queue-4.4/nfsd-fix-nfsd_minorversion-..-nfsd_avail.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-18 13:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-18 13:55 Patch "raid5: Set R5_Expanded on parity devices as well as data." has been added to the 4.4-stable tree gregkh

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).