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>
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);
}
* 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);
}
}