]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/dcache.c
drm/i915: Save the old CDCLK atomic state
[mirror_ubuntu-bionic-kernel.git] / fs / dcache.c
index 65691b5223850a6a69d41ae119a1b7f114c29be7..ca3129bfe1089a7d71cded900fc04f6354d2fcaf 100644 (file)
@@ -2483,7 +2483,7 @@ struct dentry *d_alloc_parallel(struct dentry *parent,
 
 retry:
        rcu_read_lock();
-       seq = smp_load_acquire(&parent->d_inode->i_dir_seq) & ~1;
+       seq = smp_load_acquire(&parent->d_inode->i_dir_seq);
        r_seq = read_seqbegin(&rename_lock);
        dentry = __d_lookup_rcu(parent, name, &d_seq);
        if (unlikely(dentry)) {
@@ -2504,8 +2504,14 @@ retry:
                rcu_read_unlock();
                goto retry;
        }
+
+       if (unlikely(seq & 1)) {
+               rcu_read_unlock();
+               goto retry;
+       }
+
        hlist_bl_lock(b);
-       if (unlikely(parent->d_inode->i_dir_seq != seq)) {
+       if (unlikely(READ_ONCE(parent->d_inode->i_dir_seq) != seq)) {
                hlist_bl_unlock(b);
                rcu_read_unlock();
                goto retry;