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