From 60689bd26f0c9cb9e761f2cf8c5f2b90e39884eb Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Fri, 16 Nov 2018 11:25:16 +0530 Subject: features/locks: Move logging outside of a locked region In pl_metalk(), logging was being done in a synchronized region. Moving the log out of the synchronized region to avoid other threads from being blocked on the lock. Thanks to Yaniv Kaul for pointing this out. Change-Id: I0cb39fb23ae7c798ca9c42c390500491aa8e622b updates: bz#1644758 Signed-off-by: Vijay Bellur --- xlators/features/locks/src/posix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xlators/features/locks/src/posix.c') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index a922b048fd4..af162c5284c 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -2943,15 +2943,15 @@ pl_metalk(call_frame_t *frame, xlator_t *this, inode_t *inode) pthread_mutex_lock(&pl_inode->mutex); { if (pl_metalock_is_active(pl_inode)) { - gf_msg(this->name, GF_LOG_WARNING, EINVAL, 0, - "More than one meta-lock can not be granted on" - "the inode"); ret = -1; } } pthread_mutex_unlock(&pl_inode->mutex); if (ret == -1) { + gf_msg(this->name, GF_LOG_WARNING, EINVAL, 0, + "More than one meta-lock cannot be granted on" + " the inode"); goto out; } -- cgit