From: Mikhal Pershin Date: Thu, 3 Nov 2016 22:17:30 +0000 (+0800) Subject: LU-9066 ldlm: don't evict client on umount if AST fails X-Git-Tag: 2.9.55~41 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=eda984e7cb4e6a97310ed0f5e81f398dc48b56bf LU-9066 ldlm: don't evict client on umount if AST fails When server is being stopped the AST send is denied and that AST failure will lead to the unexpected client eviction. Patch adds extra checks in ldlm_handle_ast_error() to distinguish that type of error and proceed without eviction. Signed-off-by: Mikhal Pershin Change-Id: I57c7f417376ac64c8df4c6d5f68bea5083c0d22f Reviewed-on: https://review.whamcloud.com/23921 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Niu Yawei Reviewed-by: Oleg Drokin --- diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 807da6f..651eebe 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -669,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",