[CRIU] [PATCH] unshare: Check private remount error code

Pavel Emelyanov xemul at virtuozzo.com
Wed Mar 16 05:25:05 PDT 2016


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/mount.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/criu/mount.c b/criu/mount.c
index 9757799..754bf27 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -3196,7 +3196,11 @@ int prepare_mnt_ns(void)
 		}
 
 		if (opts.unshare_flags & UNSHARE_MOUNT_PROC) {
-			mount(NULL, "/proc", NULL, MS_PRIVATE, NULL);
+			if (mount(NULL, "/proc", NULL, MS_PRIVATE, NULL)) {
+				pr_perror("Can't make proc private for unshare");
+				return -1;
+			}
+
 			if (mount("proc", "/proc", "proc",
 						MS_MGC_VAL | MS_NOSUID | MS_NOEXEC | MS_NODEV,
 						NULL)) {
-- 
2.5.0


More information about the CRIU mailing list