From: pschwan Date: Fri, 4 Oct 2002 14:29:59 +0000 (+0000) Subject: Make ldlm_cli_cancel_unused not return an error for invalid resource. This is X-Git-Tag: 0.5.14~63 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=d95431a9aeddae9f5d74aa0da527f74494106b7e;p=fs%2Flustre-release.git Make ldlm_cli_cancel_unused not return an error for invalid resource. This is a very common case, where a file is opened and then closed without locks having been taken. --- diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index 5917b56..3947602 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -485,8 +485,11 @@ int ldlm_cli_cancel_unused(struct ldlm_namespace *ns, __u64 *res_id, ENTRY; res = ldlm_resource_get(ns, NULL, res_id, 0, 0); - if (res == NULL) - RETURN(-EINVAL); + if (res == NULL) { + /* This is not a problem. */ + CDEBUG(D_INFO, "No resource "LPU64"\n", res_id[0]); + RETURN(0); + } l_lock(&ns->ns_lock); list_for_each(tmp, &res->lr_granted) {