Grow: close fd earlier to avoid "cannot get excl access" when stopping

If this file descriptor is not closed here, it remains open during
reshape process and stopping process will end up with
"cannot get exclusive access to container".
Once this file descriptor is no longer needed - it can be closed.

Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
This commit is contained in:
Pawel Baldysiak 2016-03-11 13:49:07 +01:00 committed by Jes Sorensen
parent d31d0f5218
commit ad2f464602
1 changed files with 4 additions and 0 deletions

4
Grow.c
View File

@ -2070,6 +2070,10 @@ size_change_error:
* number of devices (On-Line Capacity Expansion) must be
* performed at the level of the container
*/
if (fd > 0) {
close(fd);
fd = -1;
}
rv = reshape_container(container, devname, -1, st, &info,
c->force, c->backup_file, c->verbose, 0, 0, 0);
frozen = 0;