2072c5
From e9cb714d66a7926a746b8cd5f9288d59aefee918 Mon Sep 17 00:00:00 2001
2072c5
From: Kinglong Mee <kinglongmee@gmail.com>
2072c5
Date: Mon, 18 Mar 2019 20:47:54 +0800
2072c5
Subject: [PATCH 391/392] cluster-syncop: avoid duplicate unlock of
2072c5
 inodelk/entrylk
2072c5
2072c5
When using ec, there are many messages at brick log as,
2072c5
2072c5
[inodelk.c:514:__inode_unlock_lock] 0-test-locks:  Matching lock not found for unlock 0-9223372036854775807, lo=68e040a84b7f0000 on 0x7f208c006f78
2072c5
[MSGID: 115053] [server-rpc-fops_v2.c:280:server4_inodelk_cbk] 0-test-server: 2557439: INODELK <gfid:df4e41be-723f-4289-b7af-b4272b3e880c> (df4e41be-723f-4289-b7af-b4272b3e880c), client: CTX_ID:67d4a7f3-605a-4965-89a5-31309d62d1fa-GRAPH_ID:0-PID:1659-HOST:openfs-node2-PC_NAME:test-client-1-RECON_NO:-28, error-xlator: test-locks [Invalid argument]
2072c5
2072c5
> Change-Id: Ib164d29ebb071f620a4ca9679c4345ef7c88512a
2072c5
> Updates: bz#1689920
2072c5
> Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
2072c5
> Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/22377/
2072c5
2072c5
BUG: 1848890
2072c5
Change-Id: Ib164d29ebb071f620a4ca9679c4345ef7c88512a
2072c5
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
2072c5
Reviewed-on: https://code.engineering.redhat.com/gerrit/203852
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