Whamcloud - gitweb
LU-8221 osc: fix for lu_ref feature in osc_extent_put() 19/20519/4
authorBruno Faccini <bruno.faccini@intel.com>
Thu, 7 Jan 2016 09:11:30 +0000 (10:11 +0100)
committerOleg Drokin <green@whamcloud.com>
Tue, 17 Mar 2020 03:40:18 +0000 (03:40 +0000)
Trying to enable and use the USE_LU_REF/lu_ref feature, a previous
clio related changes have been found to silently (as feature
has not been tested since!) break it.

In osc_extent_put(), there is no need to remove an
implicit "handle" reference, by using LDLM_LOCK_PUT() macro, since
it has never been acquired before. This was introduced by
3f3a24d LU-3259 clio: cl_lock simplification

And the "osc_extent" reference must be deleted instead added.

This patch makes the necessary changes to fix all of these.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: I86599ff97310b16c9599b6a52a88693872ae6d30
Reviewed-on: https://review.whamcloud.com/20519
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>

index b74736c..a9f2cc1 100644 (file)
@@ -362,9 +362,9 @@ static void osc_extent_put(const struct lu_env *env, struct osc_extent *ext)
                if (ext->oe_dlmlock != NULL) {
-                       lu_ref_add(&ext->oe_dlmlock->l_reference,
+                       lu_ref_del(&ext->oe_dlmlock->l_reference,
                                   "osc_extent", ext);
-                       LDLM_LOCK_PUT(ext->oe_dlmlock);
+                       LDLM_LOCK_RELEASE(ext->oe_dlmlock);
                        ext->oe_dlmlock = NULL;
                cl_object_put(env, osc2cl(ext->oe_obj));