[CRIU] [PATCH 4/4] mount: handle old images where sb and mnt options were not separated

Andrey Vagin avagin at openvz.org
Tue Aug 11 08:33:36 PDT 2015


Currently we have only one common flag. It is MS_READONLY and it's
interpreted as a super block flag to not change old behaviour.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 mount.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/mount.c b/mount.c
index 4589399..06b5399 100644
--- a/mount.c
+++ b/mount.c
@@ -2335,6 +2335,15 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
 		pm->s_dev		= me->root_dev;
 		pm->flags		= me->flags;
 		pm->sb_flags		= me->sb_flags;
+		if (!me->has_sb_flags) {
+			unsigned int mflags = MS_SHARED | MS_PRIVATE |
+						MS_SLAVE | MS_UNBINDABLE |
+						MS_NOSUID | MS_NODEV | MS_NOEXEC |
+						MS_NOATIME | MS_NODIRATIME | MS_RELATIME;
+
+			pm->sb_flags = pm->flags & ~mflags;
+			pm->flags = pm->flags & mflags;
+		}
 		pm->shared_id		= me->shared_id;
 		pm->master_id		= me->master_id;
 		pm->need_plugin		= me->with_plugin;
-- 
2.1.0



More information about the CRIU mailing list