a3470f
From 149a69ffa4aadca1d4d495957e5e7fd068756f64 Mon Sep 17 00:00:00 2001
a3470f
From: hari gowtham <hgowtham@redhat.com>
a3470f
Date: Fri, 18 May 2018 15:05:37 +0530
a3470f
Subject: [PATCH 291/305] Core: The lock contention on
a3470f
 gf_client_dump_inodes_to_dict
a3470f
a3470f
        backport of:https://review.gluster.org/#/c/20035/
a3470f
a3470f
Problem: For a distributed replicated volume, in the inode status
a3470f
command the lock on gf_client_dump_inodes_to_dict is held by the
a3470f
first brickop. while this is being processed, if the second brickop
a3470f
comes. It fails to get the lock and the whole brick op fails.
a3470f
a3470f
Fix: Instead of using a TRY_LOCK which errors out if the lock is busy,
a3470f
Use LOCK which will wait till the lock is acquired.
a3470f
a3470f
>Change-Id: I768a0a1b60f28c4f7f94549e18ee3765b69cc528
a3470f
>Signed-off-by: hari gowtham <hgowtham@redhat.com>
a3470f
>BUG: 1559452
a3470f
a3470f
fixes: bz#1579769
a3470f
Change-Id: I768a0a1b60f28c4f7f94549e18ee3765b69cc528
a3470f
BUG: 1559452
a3470f
Signed-off-by: hari gowtham <hgowtham@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/140334
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
a3470f
---
a3470f
 libglusterfs/src/client_t.c | 2 +-
a3470f
 1 file changed, 1 insertion(+), 1 deletion(-)
a3470f
a3470f
diff --git a/libglusterfs/src/client_t.c b/libglusterfs/src/client_t.c
a3470f
index dc153cc..17e3026 100644
a3470f
--- a/libglusterfs/src/client_t.c
a3470f
+++ b/libglusterfs/src/client_t.c
a3470f
@@ -849,7 +849,7 @@ gf_client_dump_inodes_to_dict (xlator_t *this, dict_t *dict)
a3470f
         if (!clienttable)
a3470f
                 return -1;
a3470f
 
a3470f
-        ret = TRY_LOCK (&clienttable->lock);
a3470f
+        ret = LOCK (&clienttable->lock);
a3470f
         {
a3470f
                 if (ret) {
a3470f
                         gf_msg ("client_t", GF_LOG_WARNING, 0,
a3470f
-- 
a3470f
1.8.3.1
a3470f