summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2014-01-19 19:44:06 -0800
committerVijay Bellur <vbellur@redhat.com>2014-01-22 23:55:29 -0800
commitcd65bab3a1586e03178e8b683afea26bd324a71b (patch)
treed3cead769dbd0bda348b3e40b32cb3535308e156
parent0f8fb23ec622ec8f96649780804019721e1bd364 (diff)
locks: set @lock->frame = NULL when lock is granted
This way disconnect cleanup code can differentiate which locks are granted vs blocked. Change-Id: I2a835c6865b6c804231d852953ea84eeccef35a3 BUG: 849630 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/6762 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--xlators/features/locks/src/entrylk.c7
-rw-r--r--xlators/features/locks/src/inodelk.c1
2 files changed, 5 insertions, 3 deletions
diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c
index 208bc140e..c176306fe 100644
--- a/xlators/features/locks/src/entrylk.c
+++ b/xlators/features/locks/src/entrylk.c
@@ -371,7 +371,6 @@ __lock_entrylk (xlator_t *this, pl_inode_t *pinode, pl_entry_lock_t *lock,
__pl_entrylk_ref (lock);
gettimeofday (&lock->granted_time, NULL);
list_add (&lock->domain_list, &dom->entrylk_list);
- lock->frame = NULL;
ret = 0;
out:
@@ -576,10 +575,12 @@ pl_common_entrylk (call_frame_t *frame, xlator_t *this,
reqlock->pinode = pinode;
ret = __lock_entrylk (this, pinode, reqlock, nonblock, dom);
- if (ret == 0)
+ if (ret == 0) {
+ reqlock->frame = NULL;
op_ret = 0;
- else
+ } else {
op_errno = -ret;
+ }
if (ctx && (!ret || !nonblock))
list_add (&reqlock->client_list,
diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c
index 969b67a61..e7093e60e 100644
--- a/xlators/features/locks/src/inodelk.c
+++ b/xlators/features/locks/src/inodelk.c
@@ -478,6 +478,7 @@ pl_inode_setlk (xlator_t *this, pl_ctx_t *ctx, pl_inode_t *pl_inode,
if (lock->fl_type != F_UNLCK) {
ret = __lock_inodelk (this, pl_inode, lock, can_block, dom);
if (ret == 0) {
+ lock->frame = NULL;
gf_log (this->name, GF_LOG_TRACE,
"%s (pid=%d) (lk-owner=%s) %"PRId64" - %"PRId64" => OK",
lock->fl_type == F_UNLCK ? "Unlock" : "Lock",