summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2019-03-18 20:47:54 +0800
committerShyamsundar Ranganathan <srangana@redhat.com>2019-04-08 14:18:16 +0000
commitb399d33d575bb2e2cb7af5232e96a091d4768682 (patch)
tree01f117ee39dc1096d0c39eae0de0616db4324e91 /libglusterfs
parente1eee0caf6c963ab32dc202ad7e1ecb81675ec49 (diff)
cluster-syncop: avoid duplicate unlock of inodelk/entrylk
When using ec, there are many messages at brick log as, [inodelk.c:514:__inode_unlock_lock] 0-test-locks: Matching lock not found for unlock 0-9223372036854775807, lo=68e040a84b7f0000 on 0x7f208c006f78 [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] > Change-Id: Ib164d29ebb071f620a4ca9679c4345ef7c88512a > Signed-off-by: Kinglong Mee <mijinlong@open-fs.com> (cherry-pick of https://review.gluster.org/#/c/glusterfs/+/22377/) Change-Id: I8345ad6c8e1bbb676917eb47e1c5ed72c162f6ce Updates: bz#1690952 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/cluster-syncop.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/cluster-syncop.c b/libglusterfs/src/cluster-syncop.c
index dab00577886..9179e99bfad 100644
--- a/libglusterfs/src/cluster-syncop.c
+++ b/libglusterfs/src/cluster-syncop.c
@@ -1203,6 +1203,10 @@ cluster_tiebreaker_inodelk(xlator_t **subvols, unsigned char *on,
if (num_success) {
FOP_SEQ(subvols, on, numsubvols, replies, locked_on, frame,
inodelk, dom, &loc, F_SETLKW, &flock, NULL);
+ } else {
+ loc_wipe(&loc);
+ memset(locked_on, 0, numsubvols);
+ return 0;
}
break;
}
@@ -1244,7 +1248,9 @@ cluster_tiebreaker_entrylk(xlator_t **subvols, unsigned char *on,
entrylk, dom, &loc, name, ENTRYLK_LOCK, ENTRYLK_WRLCK,
NULL);
} else {
+ loc_wipe(&loc);
memset(locked_on, 0, numsubvols);
+ return 0;
}
break;
}