summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/locks/src/clear.c2
-rw-r--r--xlators/features/locks/src/common.c1
-rw-r--r--xlators/features/locks/src/entrylk.c3
-rw-r--r--xlators/features/locks/src/inodelk.c7
-rw-r--r--xlators/features/locks/src/posix.c3
5 files changed, 11 insertions, 5 deletions
diff --git a/xlators/features/locks/src/clear.c b/xlators/features/locks/src/clear.c
index f6897333ce..a76d6beacb 100644
--- a/xlators/features/locks/src/clear.c
+++ b/xlators/features/locks/src/clear.c
@@ -183,7 +183,7 @@ clrlk_clear_posixlk (xlator_t *this, pl_inode_t *pl_inode, clrlk_args *args,
} else {
gcount++;
}
- GF_FREE (plock);
+ __destroy_lock(plock);
}
}
pthread_mutex_unlock (&pl_inode->mutex);
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c
index b8c09a988e..c22dff0838 100644
--- a/xlators/features/locks/src/common.c
+++ b/xlators/features/locks/src/common.c
@@ -437,6 +437,7 @@ pl_inode_get (xlator_t *this, inode_t *inode)
ret = __inode_ctx_put (inode, this, (uint64_t)(long)(pl_inode));
if (ret) {
+ pthread_mutex_destroy (&pl_inode->mutex);
GF_FREE (pl_inode);
pl_inode = NULL;
goto unlock;
diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c
index 0dfc9df737..6698516fc8 100644
--- a/xlators/features/locks/src/entrylk.c
+++ b/xlators/features/locks/src/entrylk.c
@@ -783,7 +783,7 @@ pl_common_entrylk (call_frame_t *frame, xlator_t *this,
break;
default:
- inode_unref (pinode->inode);
+ need_inode_unref = _gf_true;
gf_log (this->name, GF_LOG_ERROR,
"Unexpected case in entrylk (cmd=%d). Please file"
"a bug report at http://bugs.gluster.com", cmd);
@@ -959,6 +959,7 @@ pl_entrylk_client_cleanup (xlator_t *this, pl_ctx_t *ctx)
__pl_entrylk_unref (l);
}
pthread_mutex_unlock (&pinode->mutex);
+
inode_unref (pinode->inode);
}
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index a8381adda3..64ffb00c18 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -720,9 +720,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.
*/
@@ -731,6 +728,10 @@ out:
grant_blocked_inode_locks (this, pl_inode, dom);
}
+ if (need_inode_unref) {
+ inode_unref (pl_inode->inode);
+ }
+
return ret;
}
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 7e94c284ed..78bf160058 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -2471,6 +2471,7 @@ pl_forget (xlator_t *this,
list) {
list_del (&rw_req->list);
+ call_stub_destroy(rw_req->stub);
GF_FREE (rw_req);
}
}
@@ -2554,6 +2555,8 @@ pl_forget (xlator_t *this,
}
+ pthread_mutex_destroy(&pl_inode->mutex);
+
GF_FREE (pl_inode);
return 0;