Grow: close file descriptor earlier to avoid "still in use" when stopping

Close fd2 as soon as it is no longer needed, before calling
Grow_continue(). Otherwise, we won't be able to stop an array with
external metadata during reshape, because mdadm running in background
will be keeping it open.

Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
This commit is contained in:
Artur Paszkiewicz 2015-12-23 12:57:10 +01:00 committed by NeilBrown
parent e652d1aa29
commit 10df72a080
1 changed files with 3 additions and 0 deletions

3
Grow.c
View File

@ -4885,6 +4885,9 @@ int Grow_continue_command(char *devname, int fd,
sysfs_init(content, fd2, mdstat->devnm);
close(fd2);
fd2 = -1;
/* start mdmon in case it is not running
*/
if (!mdmon_running(container))