Whamcloud - gitweb
Make ldlm_cli_cancel_unused not return an error for invalid resource. This is
authorpschwan <pschwan>
Fri, 4 Oct 2002 14:29:59 +0000 (14:29 +0000)
committerpschwan <pschwan>
Fri, 4 Oct 2002 14:29:59 +0000 (14:29 +0000)
a very common case, where a file is opened and then closed without locks having
been taken.

lustre/ldlm/ldlm_request.c

index 5917b56..3947602 100644 (file)
@@ -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) {