]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fix autofs regression caused by follow_managed() changes
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 15 Jan 2020 03:09:57 +0000 (22:09 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 15 Jan 2020 06:36:46 +0000 (01:36 -0500)
we need to reload ->d_flags after the call of ->d_manage() - the thing
might've been called with dentry still negative and have the damn thing
turned positive while we'd waited.

Fixes: 4dc54c5c43c7 "fs/namei.c: pull positivity check into follow_managed()"
Reported-by: Ian Kent <raven@themaw.net>
Tested-by: Ian Kent <raven@themaw.net>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namei.c

index 204677c37751fb98671f8f5909ef1710dd89c09f..d2720dc71d0efc111c1c2da0f2d71acf5c39c39d 100644 (file)
@@ -1232,6 +1232,7 @@ static int follow_managed(struct path *path, struct nameidata *nd)
                        BUG_ON(!path->dentry->d_op);
                        BUG_ON(!path->dentry->d_op->d_manage);
                        ret = path->dentry->d_op->d_manage(path, false);
+                       flags = smp_load_acquire(&path->dentry->d_flags);
                        if (ret < 0)
                                break;
                }