linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [mdadm PATCH] Grow raid disks without backup file fail
@ 2015-12-01  7:42 Xiao Ni
  0 siblings, 0 replies; only message in thread
From: Xiao Ni @ 2015-12-01  7:42 UTC (permalink / raw)
  To: linux-raid

Hi Neil

When add one new disk to a raid5 and try to grow the number members,
it's failed to start reshape.

Because before echo "reshape" to sync_action, raid5d will miss the 
chance to clear MD_RECOVERY_NEEDED. The method is as same as
start_reshape.

Signed-off-by : Xiao Ni (xni@redhat.com)
---
 Grow.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Grow.c b/Grow.c
index 80d7b22..a5bed3c 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2796,6 +2796,7 @@ static int reshape_array(char *container, int fd, char *devname,
 	int done;
 	struct mdinfo *sra = NULL;
 	char buf[20];
+	int cnt = 5;
 
 	/* when reshaping a RAID0, the component_size might be zero.
 	 * So try to fix that up.
@@ -3114,7 +3115,12 @@ static int reshape_array(char *container, int fd, char *devname,
 		if (impose_reshape(sra, info, st, fd, restart,
 				   devname, container, &reshape) < 0)
 			goto release;
-		if (sysfs_set_str(sra, NULL, "sync_action", "reshape") < 0) {
+		do {
+			err = sysfs_set_str(sra, NULL, "sync_action", "reshape");
+			if (err)
+				sleep(1);
+		} while (err && errno == EBUSY && cnt-- > 0);
+		if (err < 0) {
 			struct mdinfo *sd;
 			if (errno != EINVAL) {
 				pr_err("Failed to initiate reshape!\n");
-- 
2.4.3


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

only message in thread, other threads:[~2015-12-01  7:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01  7:42 [mdadm PATCH] Grow raid disks without backup file fail Xiao Ni

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