From 23b92780ebc69641ebf78720f7a1247b2d0e2629 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Tue, 14 Jan 2020 22:09:57 -0500 Subject: [PATCH 0989/2944] fix autofs regression caused by follow_managed() changes fix #27211210 commit 508c8772760d4ef9c1a044519b564710c3684fc5 upstream. 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: d41efb522e90 "fs/namei.c: pull positivity check into follow_managed()" Reported-by: Ian Kent Tested-by: Ian Kent Signed-off-by: Al Viro Signed-off-by: Jeffle Xu Acked-by: Joseph Qi --- fs/namei.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/namei.c b/fs/namei.c index 5973103..22c78b3b 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1237,6 +1237,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; } -- 1.8.3.1