autofs: do not create dentries for indirect mount on bind-mounts

Submitted by Stanislav Kinsburskiy on April 27, 2016, 11:24 a.m.

Details

Message ID 20160427112420.37443.68548.stgit@skinsbursky-vz7.qa.sw.ru
State Accepted
Series "autofs: do not create dentries for indirect mount on bind-mounts"
Commit ebbe601af4018b3ec81292dea2bace23c75b1805
Headers show

Commit Message

Stanislav Kinsburskiy April 27, 2016, 11:24 a.m.
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@virtuozzo.com>
---
 criu/autofs.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Patch hide | download patch | download mbox

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,

Comments

Cyrill Gorcunov April 27, 2016, 2:06 p.m.
On Wed, Apr 27, 2016 at 02:24:23PM +0300, Stanislav Kinsburskiy wrote:
> 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@virtuozzo.com>
Tested-by: Cyrill Gorcunov <gorcunov@openvz.org>

Pavel, pick it up please? Together with autofs additional fix Stas
sent today (I picked them up into our stable tree to not block the
tests, but it would be great if I could simply cherry pick them from
the vanilla repo later).
Pavel Emelianov May 4, 2016, 7:14 a.m.
Applied