[CRIU] [PATCH] autofs: do not create dentries for indirect mount on bind-mounts

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed Apr 27 04:24:23 PDT 2016


This was a silly mistake: bind-mounts share the same superblock, thus dentry
creation on a bind-monut will fail with EEXIST.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/autofs.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/criu/autofs.c b/criu/autofs.c
index 8befc62..069f67b 100644
--- a/criu/autofs.c
+++ b/criu/autofs.c
@@ -546,19 +546,10 @@ static int autofs_create_dentries(const struct mount_info *mi, char *mnt_path)
 static int autofs_populate_mount(const struct mount_info *mi,
 				 const AutofsEntry *entry)
 {
-	struct mount_info *b;
-
 	if (entry->mode != AUTOFS_MODE_INDIRECT)
 		return 0;
 
-	if (autofs_create_dentries(mi, mi->mountpoint) < 0)
-		return -1;
-
-	list_for_each_entry(b, &mi->mnt_bind, mnt_bind) {
-		if (autofs_create_dentries(b, mi->mountpoint) < 0)
-			return -1;
-	}
-	return 0;
+	return autofs_create_dentries(mi, mi->mountpoint);
 }
 
 static int autofs_post_mount(const char *mnt_path, dev_t mnt_dev,



More information about the CRIU mailing list