mount: add a comment to explain why do we need a clean mount

Submitted by Andrei Vagin on May 19, 2016, 9:08 p.m.

Details

Message ID 1463692110-1000-1-git-send-email-avagin@openvz.org
State Accepted
Series "mount: add a comment to explain why do we need a clean mount"
Commit ab858a8905496d3b2b69e401949938f354fa8efa
Headers show

Commit Message

Andrei Vagin May 19, 2016, 9:08 p.m.
From: Andrew Vagin <avagin@virtuozzo.com>

It's required when a target path is overmounted by one of child mounts.

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

Patch hide | download patch | download mbox

diff --git a/criu/mount.c b/criu/mount.c
index 6f47655..87c2791 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2514,6 +2514,10 @@  static int do_bind_mount(struct mount_info *mi)
 	if (cut_root[0] == 0) /* This case is handled by mi->bind->fd */
 		goto skip_overmount_check;
 
+	/*
+	 * The target path may be over-mounted by one of child mounts
+	 * and we need to create a new bind-mount to get access to the path.
+	 */
 	mp_len = strlen(mi->bind->mountpoint);
 	if (mp_len > 1) /* skip a joining / if mi->bind->mountpoint isn't "/" */
 		mp_len++;

Comments

Pavel Emelianov May 23, 2016, 4:51 p.m.
On 05/20/2016 12:08 AM, Andrey Vagin wrote:
> From: Andrew Vagin <avagin@virtuozzo.com>
Applied