Whamcloud - gitweb
LU-9241 llite: ASSERTION( de->d_op == &ll_d_ops ) failed 09/26109/3
authorAndriy Skulysh <andriy.skulysh@seagate.com>
Wed, 22 Mar 2017 10:21:15 +0000 (12:21 +0200)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 16 May 2017 05:46:38 +0000 (05:46 +0000)
The assertion can be checked while dentry isn't fully
initialized in HAVE_DCACHE_LOCK case.

Reorder assignments to make assertion always true.
Later ll_dentry_data bitfields modification should be
protected by a spinlock.

Change-Id: I4a1ea42b9fe1c9398539a1a241b8a191dba5903c
Seagate-bug-id: MRP-4257
Signed-off-by: Andriy Skulysh <andriy.skulysh@seagate.com>
Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-on: https://review.whamcloud.com/26109
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/dcache.c
lustre/llite/llite_nfs.c

index a8fb890..6b2fdf3 100644 (file)
@@ -170,12 +170,13 @@ int ll_d_init(struct dentry *de)
                if (likely(lld != NULL)) {
                        spin_lock(&de->d_lock);
                        if (likely(de->d_fsdata == NULL)) {
-                               de->d_fsdata = lld;
-                               __d_lustre_invalidate(de);
 #ifdef HAVE_DCACHE_LOCK
                                /* kernel >= 2.6.38 d_op is set in d_alloc() */
                                de->d_op = &ll_d_ops;
+                               smp_mb();
 #endif
+                               de->d_fsdata = lld;
+                               __d_lustre_invalidate(de);
                        } else {
                                OBD_FREE_PTR(lld);
                        }
index 9b15396..c24f7f6 100644 (file)
@@ -148,7 +148,9 @@ ll_iget_for_nfs(struct super_block *sb, struct lu_fid *fid, struct lu_fid *paren
                         * we came from NFS and so opencache needs to be
                         * enabled for this one
                         */
+                       spin_lock(&result->d_lock);
                        ldd->lld_nfs_dentry = 1;
+                       spin_unlock(&result->d_lock);
                }
        }