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