mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] autofs4: use ACCESS_ONCE rather than rcu_dereference for dentry->d_inode
@ 2014-09-03  4:06 NeilBrown
  0 siblings, 0 replies; only message in thread
From: NeilBrown @ 2014-09-03  4:06 UTC (permalink / raw)
  To: Andrew Morton; +Cc: kbuild-all, lkml, Ian Kent, autofs

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]



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 mode.
in 'mm'.

Signed-off-by: NeilBrown <neilb@suse.de>

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))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-03  4:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-03  4:06 [PATCH] autofs4: use ACCESS_ONCE rather than rcu_dereference for dentry->d_inode NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®