From: NeilBrown <neilb@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kbuild-all@01.org, lkml <linux-kernel@vger.kernel.org>,
Ian Kent <raven@themaw.net>,
autofs@vger.kernel.org
Subject: [PATCH] autofs4: use ACCESS_ONCE rather than rcu_dereference for dentry->d_inode
Date: Wed, 3 Sep 2014 14:06:17 +1000 [thread overview]
Message-ID: <20140903140617.7502ad32@notabene.brown> (raw)
[-- 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 --]
reply other threads:[~2014-09-03 4:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140903140617.7502ad32@notabene.brown \
--to=neilb@suse.de \
--cc=akpm@linux-foundation.org \
--cc=autofs@vger.kernel.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=raven@themaw.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®