Blame SOURCES/stop-previous-reshape-process-first.patch

2c1b57
commit e1b942b9afa9f3310ea19c57caea896af97b557e
2c1b57
Author: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
2c1b57
Date:   Thu Sep 7 13:01:16 2017 +0200
2c1b57
2c1b57
    Grow: stop previous reshape process first
2c1b57
    
2c1b57
    If array is stopped during reshape and assembled again straight away,
2c1b57
    reshape process in a background might still be running. systemd doesn't
2c1b57
    start a new service if one already exists. If there is a race, previous
2c1b57
    process might terminate and new one is not created. Reshape doesn't
2c1b57
    continue after assemble.
2c1b57
    
2c1b57
    Tell systemd to restart the service rather than just start it. It will
2c1b57
    assure previous service is stopped first. If it's not running, stopping
2c1b57
    has no effect and only new process is started.
2c1b57
    
2c1b57
    Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
2c1b57
    Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
2c1b57
diff --git a/Grow.c b/Grow.c
2c1b57
index 534ba80..267b06f 100644
2c1b57
--- a/Grow.c
2c1b57
+++ b/Grow.c
2c1b57
@@ -3003,9 +3003,9 @@ static int continue_via_systemd(char *devnm)
2c1b57
 		snprintf(pathbuf, sizeof(pathbuf), "mdadm-grow-continue@%s.service",
2c1b57
 			 devnm);
2c1b57
 		status = execl("/usr/bin/systemctl", "systemctl",
2c1b57
-			       "start",
2c1b57
+			       "restart",
2c1b57
 			       pathbuf, NULL);
2c1b57
-		status = execl("/bin/systemctl", "systemctl", "start",
2c1b57
+		status = execl("/bin/systemctl", "systemctl", "restart",
2c1b57
 			       pathbuf, NULL);
2c1b57
 		exit(1);
2c1b57
 	case -1: /* Just do it ourselves. */