[CRIU] [PATCH] criu: don't interrupt do_new_mount() after appling mount options

Andrey Vagin avagin at openvz.org
Tue May 24 13:20:43 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

Reported-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
Cc: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 criu/mount.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index 4b0c553..d4e8e45 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2402,9 +2402,11 @@ static int do_new_mount(struct mount_info *mi)
 	if (tp->restore && tp->restore(mi))
 		return -1;
 
-	if (remount_ro)
-		return mount(NULL, mi->mountpoint, tp->name,
-			     MS_REMOUNT | MS_RDONLY, NULL);
+	if (remount_ro && mount(NULL, mi->mountpoint, tp->name,
+				     MS_REMOUNT | MS_RDONLY, NULL)) {
+		pr_perror("Unable to apply mount options");
+		return -1;
+	}
 
 	if (mflags && mount(NULL, mi->mountpoint, NULL,
 				MS_REMOUNT | MS_BIND | mflags, NULL)) {
-- 
2.7.4



More information about the CRIU mailing list