From: Niu Yawei Date: Fri, 6 May 2011 16:11:24 +0000 (-0700) Subject: LU-274 Update LVB from disk when glimpse callback return error X-Git-Tag: 1.8.5.56~19 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=8cf8ac002a32b872677b8d9064e35f8eda436a28;p=fs%2Flustre-release.git LU-274 Update LVB from disk when glimpse callback return error Client ll_glimpse_callback() could fail to get inode if the inode is already been cleared, and this glimpse callback will fail for -ELDLM_NO_LOCK_DATA, so server should update LVB from disk (in filter_intent_policy()) when it received such error from client. Issue: Signed-off-by: Niu Yawei Change-Id: I29b2fe4b35114359b0ad62106de48f5f2f696636 Reviewed-on: http://review.whamcloud.com/507 Tested-by: Hudson Reviewed-by: Johann Lombardi --- diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index f264d65..fb5a064 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1751,6 +1751,13 @@ static int filter_intent_policy(struct ldlm_namespace *ns, LASSERTF(l->l_glimpse_ast != NULL, "l == %p", l); rc = l->l_glimpse_ast(l, NULL); /* this will update the LVB */ + /* Update the LVB from disk if the AST failed (this is a legal race) */ + /* Client might return -ELDLM_NO_LOCK_DATA if the inode has been cleared + * in client cache, since the data must has been flushed to OST in such + * case, we should update LVB from disk. LU-274 */ + if (rc != 0) + ldlm_res_lvbo_update(res, NULL, 0, 1); + lock_res(res); *reply_lvb = *res_lvb;