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