aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dcache.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-02-29 12:12:46 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-02-29 12:16:43 -0500
commita528aca7f359f4b0b1d72ae406097e491a5ba9ea (patch)
tree26b95bc4e207d3bd6afc11affbfa0fe85ac53b6a /include/linux/dcache.h
parentdo_last(): ELOOP failure exit should be done after leaving RCU mode (diff)
downloadlinux-dev-a528aca7f359f4b0b1d72ae406097e491a5ba9ea.tar.xz
linux-dev-a528aca7f359f4b0b1d72ae406097e491a5ba9ea.zip
use ->d_seq to get coherency between ->d_inode and ->d_flags
Games with ordering and barriers are way too brittle. Just bump ->d_seq before and after updating ->d_inode and ->d_flags type bits, so that verifying ->d_seq would guarantee they are coherent. Cc: stable@vger.kernel.org # v3.13+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/dcache.h')
-rw-r--r--include/linux/dcache.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 7781ce110503..c4b5f4b3f8f8 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -409,9 +409,7 @@ static inline bool d_mountpoint(const struct dentry *dentry)
*/
static inline unsigned __d_entry_type(const struct dentry *dentry)
{
- unsigned type = READ_ONCE(dentry->d_flags);
- smp_rmb();
- return type & DCACHE_ENTRY_TYPE;
+ return dentry->d_flags & DCACHE_ENTRY_TYPE;
}
static inline bool d_is_miss(const struct dentry *dentry)