From: Serge Hallyn Date: Mon, 21 Sep 2015 19:33:23 +0000 (+0000) Subject: ovl_rsync: make sure to umount X-Git-Tag: lxc-2.0.0.beta1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=270261b90e7dd801c6104690d6c762df8f95dc74;p=thirdparty%2Flxc.git ovl_rsync: make sure to umount Otherwise the kernel will umount when it gets around to it, but that on lxc_destroy we may race with it and fail the rmdir of the overmounted (BUSY) rootfs. This makes lxc-test-snapshot pass for me again. Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c index b81827eae..21a64f701 100644 --- a/src/lxc/bdev.c +++ b/src/lxc/bdev.c @@ -2339,6 +2339,8 @@ static int rsync_delta_wrapper(void *data) static int ovl_rsync(struct ovl_rsync_data *data) { + int ret; + if (setgid(0) < 0) { ERROR("Failed to setgid to 0"); return -1; @@ -2368,7 +2370,12 @@ static int ovl_rsync(struct ovl_rsync_data *data) ERROR("Failed mounting new container fs"); return -1; } - if (do_rsync(data->orig->dest, data->new->dest) < 0) { + ret = do_rsync(data->orig->dest, data->new->dest); + + overlayfs_umount(data->new); + overlayfs_umount(data->orig); + + if (ret < 0) { ERROR("rsyncing %s to %s", data->orig->dest, data->new->dest); return -1; }