Whamcloud - gitweb
LU-9066 ldlm: don't evict client on umount if AST fails
[fs/lustre-release.git] / lustre / ldlm / ldlm_lockd.c
index d5db5bf..651eebe 100644 (file)
@@ -60,11 +60,6 @@ struct kobject *ldlm_kobj;
 struct kset *ldlm_ns_kset;
 struct kset *ldlm_svc_kset;
 
-struct ldlm_cb_async_args {
-        struct ldlm_cb_set_arg *ca_set_arg;
-        struct ldlm_lock       *ca_lock;
-};
-
 /* LDLM state */
 
 static struct ldlm_state *ldlm_state;
@@ -674,6 +669,23 @@ static int ldlm_handle_ast_error(struct ldlm_lock *lock,
                                   libcfs_nid2str(peer.nid));
                        ldlm_lock_cancel(lock);
                        rc = -ERESTART;
+               } else if (rc == -ENODEV || rc == -ESHUTDOWN ||
+                          (rc == -EIO &&
+                           req->rq_import->imp_state == LUSTRE_IMP_CLOSED)) {
+                       /* Upon umount process the AST fails because cannot be
+                        * sent. This shouldn't lead to the client eviction.
+                        * -ENODEV error is returned by ptl_send_rpc() for
+                        *  new request in such import.
+                        * -SHUTDOWN is returned by ptlrpc_import_delay_req()
+                        *  if imp_invalid is set or obd_no_recov.
+                        * Meanwhile there is also check for LUSTRE_IMP_CLOSED
+                        * in ptlrpc_import_delay_req() as well with -EIO code.
+                        * In all such cases errors are ignored.
+                        */
+                       LDLM_DEBUG(lock, "%s AST can't be sent due to a server"
+                                        " %s failure or umount process: rc = %d\n",
+                                        ast_type,
+                                        req->rq_import->imp_obd->obd_name, rc);
                } else {
                        LDLM_ERROR(lock,
                                   "client (nid %s) %s %s AST (req@%p x%llu status %d rc %d), evict it",
@@ -732,7 +744,9 @@ static int ldlm_cb_interpret(const struct lu_env *env,
                 * - Glimpse callback of remote lock might return
                 *   -ELDLM_NO_LOCK_DATA when inode is cleared. LU-274
                 */
-               if (rc == -ELDLM_NO_LOCK_DATA) {
+               if (unlikely(arg->gl_interpret_reply)) {
+                       rc = arg->gl_interpret_reply(env, req, data, rc);
+               } else if (rc == -ELDLM_NO_LOCK_DATA) {
                        LDLM_DEBUG(lock, "lost race - client has a lock but no "
                                   "inode");
                        ldlm_res_lvbo_update(lock->l_resource, NULL, 1);