Whamcloud - gitweb
LU-7802 ldlm: No -EINVAL for canceled != unused 75/28975/4
authorPatrick Farrell <paf@cray.com>
Mon, 18 Sep 2017 11:05:48 +0000 (06:05 -0500)
committerJohn L. Hammond <john.hammond@intel.com>
Tue, 24 Oct 2017 21:22:50 +0000 (21:22 +0000)
If any locks are removed from or added to the lru, the
check of "number unused vs number cancelled" may be wrong.
This is fine - do not return an error or print debug in
this case.

Lustre-change: https://review.whamcloud.com/28560
Lustre-commit: a5081b7362e44b8d38aee1112f9a7d3aae1642c0

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I2ee9b8d86fbd6c9bd2c29e3472e3d410ee303374
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Reviewed-on: https://review.whamcloud.com/28975
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
lustre/ldlm/ldlm_resource.c

index bf03a3a..225d3a7 100644 (file)
@@ -327,19 +327,10 @@ static ssize_t lru_size_store(struct kobject *kobj, struct attribute *attr,
                        "dropping all unused locks from namespace %s\n",
                        ldlm_ns_name(ns));
                 if (ns_connect_lru_resize(ns)) {
-                        int canceled, unused  = ns->ns_nr_unused;
-
                        /* Try to cancel all @ns_nr_unused locks. */
-                       canceled = ldlm_cancel_lru(ns, unused, 0,
-                                                  LDLM_LRU_FLAG_PASSED |
-                                                  LDLM_LRU_FLAG_CLEANUP);
-                       if (canceled < unused) {
-                               CDEBUG(D_DLMTRACE,
-                                      "not all requested locks are canceled, requested: %d, canceled: %d\n",
-                                      unused,
-                                      canceled);
-                               return -EINVAL;
-                       }
+                       ldlm_cancel_lru(ns, ns->ns_nr_unused, 0,
+                                       LDLM_LRU_FLAG_PASSED |
+                                       LDLM_LRU_FLAG_CLEANUP);
                } else {
                        tmp = ns->ns_max_unused;
                        ns->ns_max_unused = 0;