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