190130
From 5b549cbf3f1873054c6d187b09aa9f9313971b1f Mon Sep 17 00:00:00 2001
2072c5
From: Kinglong Mee <kinglongmee@gmail.com>
2072c5
Date: Mon, 18 Mar 2019 20:47:54 +0800
190130
Subject: [PATCH 414/449] cluster-syncop: avoid duplicate unlock of
2072c5
 inodelk/entrylk
2072c5
190130
When using ec, there are many spam messages in brick and client
190130
logs files.
2072c5
190130
When shd does entry heal, it takes lock on a directory using
190130
cluster_tiebreaker_inodelk(). If it does not get lock on all
190130
the bricks because other clients has got lock on some bricks,
190130
it will unlock the locks on those bricks which it got and then
190130
will try blocking locks (If any one of the previous was successful).
2072c5
190130
The problem come here. In case we do not get locks on all the
190130
required bricks, we are sending unlock request twice on those
190130
bricks where we got the locks.
190130
190130
BUG: 1750211
190130
> Upstream patch: https://review.gluster.org/#/c/glusterfs/+/22377/
2072c5
> Change-Id: Ib164d29ebb071f620a4ca9679c4345ef7c88512a
2072c5
> Updates: bz#1689920
2072c5
> Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
2072c5
190130
Change-Id: I1647548ba75fdd27fd4e20dec08db67774f43375
190130
Reviewed-on: https://code.engineering.redhat.com/gerrit/202477
190130
Tested-by: Ashish Pandey <aspandey@redhat.com>
2072c5
Tested-by: RHGS Build Bot <nigelb@redhat.com>
2072c5
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
2072c5
---
2072c5
 libglusterfs/src/cluster-syncop.c | 6 ++++++
2072c5
 1 file changed, 6 insertions(+)
2072c5
2072c5
diff --git a/libglusterfs/src/cluster-syncop.c b/libglusterfs/src/cluster-syncop.c
2072c5
index 5a08f26..6ee89dd 100644
2072c5
--- a/libglusterfs/src/cluster-syncop.c
2072c5
+++ b/libglusterfs/src/cluster-syncop.c
2072c5
@@ -1203,6 +1203,10 @@ cluster_tiebreaker_inodelk(xlator_t **subvols, unsigned char *on,
2072c5
             if (num_success) {
2072c5
                 FOP_SEQ(subvols, on, numsubvols, replies, locked_on, frame,
2072c5
                         inodelk, dom, &loc, F_SETLKW, &flock, NULL);
2072c5
+            } else {
2072c5
+                loc_wipe(&loc;;
2072c5
+                memset(locked_on, 0, numsubvols);
2072c5
+                return 0;
2072c5
             }
2072c5
             break;
2072c5
         }
2072c5
@@ -1244,7 +1248,9 @@ cluster_tiebreaker_entrylk(xlator_t **subvols, unsigned char *on,
2072c5
                         entrylk, dom, &loc, name, ENTRYLK_LOCK, ENTRYLK_WRLCK,
2072c5
                         NULL);
2072c5
             } else {
2072c5
+                loc_wipe(&loc;;
2072c5
                 memset(locked_on, 0, numsubvols);
2072c5
+                return 0;
2072c5
             }
2072c5
             break;
2072c5
         }
2072c5
-- 
2072c5
1.8.3.1
2072c5