summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/posix.c
diff options
context:
space:
mode:
authorVijay Bellur <vbellur@redhat.com>2018-11-16 11:25:16 +0530
committerAmar Tumballi <amarts@redhat.com>2018-11-19 13:10:40 +0000
commit60689bd26f0c9cb9e761f2cf8c5f2b90e39884eb (patch)
tree9dd47175747f404b9887cf1535da51c53dc00882 /xlators/features/locks/src/posix.c
parent5664c58089127ba5214a7d922eed1aa1b4932402 (diff)
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 <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/locks/src/posix.c')
-rw-r--r--xlators/features/locks/src/posix.c6
1 files changed, 3 insertions, 3 deletions
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;
}