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>
This commit is contained in:
Al Viro
2016-02-29 12:12:46 -05:00
parent 5129fa482b
commit a528aca7f3
2 changed files with 6 additions and 18 deletions

View File

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