There are various cases that glimpse callback return errors,
we should update the LVB from disk whenever the glimpse ast failed.
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I120ebcb6254cee5b797c09545d29cc7dcc12a5d2
Reviewed-on: http://review.whamcloud.com/583
Tested-by: Hudson
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LDLM_GL_CALLBACK - LDLM_FIRST_OPC);
rc = ptlrpc_queue_wait(req);
LDLM_GL_CALLBACK - LDLM_FIRST_OPC);
rc = ptlrpc_queue_wait(req);
- if (rc == -ELDLM_NO_LOCK_DATA)
+ /* Update the LVB from disk if the AST failed (this is a legal race)
+ *
+ * - Glimpse callback of local lock just return -ELDLM_NO_LOCK_DATA.
+ * - Glimpse callback of remote lock might return -ELDLM_NO_LOCK_DATA
+ * when inode is cleared. LU-274
+ */
+ if (rc == -ELDLM_NO_LOCK_DATA) {
LDLM_DEBUG(lock, "lost race - client has a lock but no inode");
LDLM_DEBUG(lock, "lost race - client has a lock but no inode");
+ ldlm_res_lvbo_update(res, NULL, 1);
+ } else if (rc != 0) {
rc = ldlm_handle_ast_error(lock, req, rc, "glimpse");
rc = ldlm_handle_ast_error(lock, req, rc, "glimpse");
rc = ldlm_res_lvbo_update(res, req, 1);
rc = ldlm_res_lvbo_update(res, req, 1);
ptlrpc_req_finished(req);
if (rc == -ERESTART)
ptlrpc_req_finished(req);
if (rc == -ERESTART)