Whamcloud - gitweb
LU-274 Update LVB from disk when glimpse callback return error
authorNiu Yawei <niu@whamcloud.com>
Fri, 6 May 2011 16:11:24 +0000 (09:11 -0700)
committerJohann Lombardi <johann@whamcloud.com>
Mon, 9 May 2011 13:59:06 +0000 (06:59 -0700)
  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 <niu@whamcloud.com>
Change-Id: I29b2fe4b35114359b0ad62106de48f5f2f696636
Reviewed-on: http://review.whamcloud.com/507
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/obdfilter/filter.c

index f264d65..fb5a064 100644 (file)
@@ -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;