summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/inodelk.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/locks/src/inodelk.c')
-rw-r--r--xlators/features/locks/src/inodelk.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index e1702c78ba1..4aebac64fae 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -721,9 +721,6 @@ out:
if (ctx)
pthread_mutex_unlock (&ctx->lock);
- if (need_inode_unref)
- inode_unref (pl_inode->inode);
-
/* The following (extra) unref corresponds to the ref that
* was done at the time the lock was granted.
*/
@@ -732,6 +729,10 @@ out:
grant_blocked_inode_locks (this, pl_inode, dom);
}
+ if (need_inode_unref) {
+ inode_unref (pl_inode->inode);
+ }
+
return ret;
}