unsigned long lli_flags;
cfs_time_t lli_contention_time;
- /* this lock protects s_d_w and p_w_ll and mmap_cnt */
+ /* this lock protects s_d_w and p_w_ll and mmap_cnt;
+ * atomic check-update of lli_smd */
spinlock_t lli_lock;
#ifdef HAVE_CLOSE_THREAD
struct list_head lli_pending_write_llaps;
LASSERT ((lsm != NULL) == ((body->valid & OBD_MD_FLEASIZE) != 0));
if (lsm != NULL) {
+ spin_lock(&lli->lli_lock);
if (lli->lli_smd == NULL) {
if (lsm->lsm_magic != LOV_MAGIC_V1 &&
lsm->lsm_magic != LOV_MAGIC_V3 &&
* with lli_smd != NULL or lock_lsm == 0 or we can
* race between lock/unlock. bug 9547 */
lli->lli_smd = lsm;
+ spin_unlock(&lli->lli_lock);
lli->lli_maxbytes = lsm->lsm_maxbytes;
if (lli->lli_maxbytes > PAGE_CACHE_MAXBYTES)
lli->lli_maxbytes = PAGE_CACHE_MAXBYTES;
} else {
+ spin_unlock(&lli->lli_lock);
if ((lli->lli_smd->lsm_magic == lsm->lsm_magic ||
(lli->lli_smd->lsm_magic == LOV_MAGIC_V3 &&
lsm->lsm_magic == LOV_MAGIC_V1) ||