[CRIU] [PATCH CRIU 3/4] mount: do not mark mount internaly shared if match is master not share

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Jan 20 07:42:57 PST 2016


For mounts which at the same time are slave and shared we
might've found external master but not external share, so in
that case we do not need to mark mountinfo as internal sharing.

https://jira.sw.ru/browse/PSBM-42829
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 mount.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mount.c b/mount.c
index 424949a..56d732d 100644
--- a/mount.c
+++ b/mount.c
@@ -874,7 +874,11 @@ static int resolve_external_mounts(struct mount_info *info)
 			if (!opts.enable_external_sharing)
 				continue;
 
-			if (m->shared_id != match->shared_id)
+			if (m->flags & MS_SLAVE) {
+				if (m->shared_id != match->shared_id &&
+				    m->master_id != match->shared_id)
+					m->internal_sharing = true;
+			} else if (m->shared_id != match->shared_id)
 				m->internal_sharing = true;
 		}
 
-- 
1.9.3



More information about the CRIU mailing list