Commit e2335e5d authored by jcl's avatar jcl Committed by Greg Kroah-Hartman

staging/lustre/llite: force lvb_data update after layout change

When a file is restored the layout lock is first
associated with the released layout and after restore
it has to be assocaited with the new layout. This patch
forces lvb_data update in ll_layout_fetch() even if one
is present (case for released->normal state change)

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3299
Lustre-change: http://review.whamcloud.com/6291Signed-off-by: default avatarJC Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: default avatarJohann Lombardi <johann.lombardi@intel.com>
Signed-off-by: default avatarPeng Tao <tao.peng@emc.com>
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 56f4c5a8
...@@ -2941,7 +2941,11 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock) ...@@ -2941,7 +2941,11 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
int rc; int rc;
ENTRY; 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); RETURN(0);
/* if layout lock was granted right away, the layout is returned /* if layout lock was granted right away, the layout is returned
...@@ -2977,15 +2981,13 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock) ...@@ -2977,15 +2981,13 @@ static int ll_layout_fetch(struct inode *inode, struct ldlm_lock *lock)
memcpy(lvbdata, lmm, lmmsize); memcpy(lvbdata, lmm, lmmsize);
lock_res_and_lock(lock); lock_res_and_lock(lock);
if (lock->l_lvb_data == NULL) { if (lock->l_lvb_data != NULL)
lock->l_lvb_data = lvbdata; OBD_FREE_LARGE(lock->l_lvb_data, lock->l_lvb_len);
lock->l_lvb_len = lmmsize;
lvbdata = NULL; lock->l_lvb_data = lvbdata;
} lock->l_lvb_len = lmmsize;
unlock_res_and_lock(lock); unlock_res_and_lock(lock);
if (lvbdata != NULL)
OBD_FREE_LARGE(lvbdata, lmmsize);
EXIT; EXIT;
out: out:
...@@ -3017,7 +3019,7 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, ldlm_mode_t mode, ...@@ -3017,7 +3019,7 @@ static int ll_layout_lock_set(struct lustre_handle *lockh, ldlm_mode_t mode,
LASSERT(ldlm_has_layout(lock)); LASSERT(ldlm_has_layout(lock));
LDLM_DEBUG(lock, "File %p/"DFID" being reconfigured: %d.\n", 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 */ /* in case this is a caching lock and reinstate with new inode */
md_set_lock_data(sbi->ll_md_exp, &lockh->cookie, inode, NULL); md_set_lock_data(sbi->ll_md_exp, &lockh->cookie, inode, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment