linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Grow: Do not try to restart if reshape is running
@ 2014-07-16 10:20 Pawel Baldysiak
  2014-07-17  4:11 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Baldysiak @ 2014-07-16 10:20 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, pawel.baldysiak, artur.paszkiewicz

Grow process did not check if reshape is already started
when deciding about restarting.
Sync_action should be checked in this case, and if
reshape is running - restart flag should not be set.
Otherwise, Grow process will fail to write data to
sysfs, and reshape will not be continued.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
---
 Grow.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Grow.c b/Grow.c
index a2f4f14..9ba7f76 100644
--- a/Grow.c
+++ b/Grow.c
@@ -2822,6 +2822,7 @@ static int reshape_array(char *container, int fd, char *devname,
 	unsigned long long array_size;
 	int done;
 	struct mdinfo *sra = NULL;
+	char buf[20];
 
 	/* when reshaping a RAID0, the component_size might be zero.
 	 * So try to fix that up.
@@ -2869,7 +2870,9 @@ static int reshape_array(char *container, int fd, char *devname,
 		goto release;
 	}
 
-	if (st->ss->external && restart && (info->reshape_progress == 0)) {
+	if (st->ss->external && restart && (info->reshape_progress == 0) &&
+		!((sysfs_get_str(info, NULL, "sync_action", buf, sizeof(buf)) > 0) &&
+		(strncmp(buf, "reshape", 7) == 0))) {
 		/* When reshape is restarted from '0', very begin of array
 		 * it is possible that for external metadata reshape and array
 		 * configuration doesn't happen.


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-17  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16 10:20 [PATCH] Grow: Do not try to restart if reshape is running Pawel Baldysiak
2014-07-17  4:11 ` NeilBrown

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