int rc;
ENTRY;
- if (lock->l_lvb_data != NULL)
+ CDEBUG(D_INODE, DFID" LVB_READY=%d l_lvb_data=%p l_lvb_len=%d\n",
+ PFID(ll_inode2fid(inode)), !!(lock->l_flags & LDLM_FL_LVB_READY),
+ lock->l_lvb_data, lock->l_lvb_len);
+
+ if ((lock->l_lvb_data != NULL) && (lock->l_flags & LDLM_FL_LVB_READY))
RETURN(0);
/* if layout lock was granted right away, the layout is returned
memcpy(lvbdata, lmm, lmmsize);
lock_res_and_lock(lock);
- if (lock->l_lvb_data == NULL) {
- lock->l_lvb_data = lvbdata;
- lock->l_lvb_len = lmmsize;
- lvbdata = NULL;
- }
+ if (lock->l_lvb_data != NULL)
+ OBD_FREE_LARGE(lock->l_lvb_data, lock->l_lvb_len);
+
+ lock->l_lvb_data = lvbdata;
+ lock->l_lvb_len = lmmsize;
unlock_res_and_lock(lock);
- if (lvbdata != NULL)
- OBD_FREE_LARGE(lvbdata, lmmsize);
EXIT;
out:
LASSERT(ldlm_has_layout(lock));
LDLM_DEBUG(lock, "File %p/"DFID" being reconfigured: %d.\n",
- inode, PFID(&lli->lli_fid), reconf);
+ inode, PFID(&lli->lli_fid), reconf);
/* in case this is a caching lock and reinstate with new inode */
md_set_lock_data(sbi->ll_md_exp, &lockh->cookie, inode, NULL);