[1/4] mount: don't apply superblock flags for external mounts

Submitted by Andrei Vagin on Oct. 28, 2016, 7:19 a.m.

Details

Message ID 1477639147-17491-2-git-send-email-avagin@openvz.org
State Superseded
Series "Fix a few issues to dump/restore Docker containers with userns"
Headers show

Commit Message

Andrei Vagin Oct. 28, 2016, 7:19 a.m.
From: Andrei Vagin <avagin@virtuozzo.com>

We should not change an external resources.

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
---
 criu/mount.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 30e7788..00ecec5 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -1725,8 +1725,8 @@  static int do_new_mount(struct mount_info *mi)
 		goto out;
 	}
 
-	if (remount_ro && mount(NULL, mi->mountpoint, tp->name,
-				     MS_REMOUNT | MS_RDONLY, NULL)) {
+	if (!mi->is_ns_root && !mi->external && remount_ro &&
+	    mount(NULL, mi->mountpoint, tp->name, MS_REMOUNT | MS_RDONLY, NULL)) {
 		pr_perror("Unable to apply mount options");
 		return -1;
 	}