summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-09-10 09:40:49 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2014-09-10 09:40:49 +1000
commit9cc09972824297eadce2ec5b6fd88380957a63a1 (patch)
tree3e86bd08bc53925fb3a8bc0cc13338398a882a2d /fs
parenta193bceee466e4caddadeca0915bef326a55a59f (diff)
autofs4: use ACCESS_ONCE rather than rcu_dereference for dentry->d_inode
As the kbuild test robot reports, rcu_dereference() isn't really appropriate here - we don't need a memory barrier, just a guard against accidentally dereferencing NULL. This can be merged into autofs4: d_manage() should return -EISDIR when appropriate in rcu-walk mod= e. in 'mm'. Signed-off-by: NeilBrown <neilb@suse.de> Cc: Ian Kent <raven@themaw.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/autofs4/root.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 71e4413d65c8..d76d083f2f06 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -463,7 +463,7 @@ static int autofs4_d_manage(struct dentry *dentry, bool rcu_walk)
return 0;
if (d_mountpoint(dentry))
return 0;
- inode = rcu_dereference(dentry->d_inode);
+ inode = ACCESS_ONCE(dentry->d_inode);
if (inode && S_ISLNK(inode->i_mode))
return -EISDIR;
if (list_empty(&dentry->d_subdirs))