diff options
author | l17zhou <cynthia.zhou@nokia-sbell.com> | 2019-12-03 07:43:35 +0200 |
---|---|---|
committer | gluster-ant <bugzilla-bot@gluster.org> | 2019-12-03 07:43:35 +0200 |
commit | d342c17c998957a12618aac0c784c1e963a3894e (patch) | |
tree | a607c94c3bfe5a3226ec63522ec1d583e09f240c | |
parent | 08369a6e3167dc328a7a1155521340add23d02b4 (diff) | |
download | glusterfs-d342c17c998957a12618aac0c784c1e963a3894e.tar.gz glusterfs-d342c17c998957a12618aac0c784c1e963a3894e.tar.xz glusterfs-d342c17c998957a12618aac0c784c1e963a3894e.zip |
add clean local after grant lock
found by flock test, without correct ref number of fd,
lock will not be correctly released.
Fixes: bz#1779089
Change-Id: I3e466b17c852eb219c8778e43af8ad670a8449cc
Signed-off-by: l17zhou <cynthia.zhou@nokia-sbell.com>
-rw-r--r-- | xlators/features/locks/src/common.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index c78d537203..4c6b78c237 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -962,7 +962,7 @@ grant_blocked_locks(xlator_t *this, pl_inode_t *pl_inode) struct list_head granted_list; posix_lock_t *tmp = NULL; posix_lock_t *lock = NULL; - + pl_local_t *local = NULL; INIT_LIST_HEAD(&granted_list); pthread_mutex_lock(&pl_inode->mutex); @@ -977,9 +977,9 @@ grant_blocked_locks(xlator_t *this, pl_inode_t *pl_inode) pl_trace_out(this, lock->frame, NULL, NULL, F_SETLKW, &lock->user_flock, 0, 0, NULL); - - STACK_UNWIND_STRICT(lk, lock->frame, 0, 0, &lock->user_flock, NULL); - + local = lock->frame->local; + PL_STACK_UNWIND_AND_FREE(local, lk, lock->frame, 0, 0, + &lock->user_flock, NULL); __destroy_lock(lock); } @@ -999,6 +999,7 @@ pl_send_prelock_unlock(xlator_t *this, pl_inode_t *pl_inode, struct list_head granted_list; posix_lock_t *tmp = NULL; posix_lock_t *lock = NULL; + pl_local_t *local = NULL; int ret = -1; @@ -1026,9 +1027,9 @@ pl_send_prelock_unlock(xlator_t *this, pl_inode_t *pl_inode, pl_trace_out(this, lock->frame, NULL, NULL, F_SETLKW, &lock->user_flock, 0, 0, NULL); - - STACK_UNWIND_STRICT(lk, lock->frame, 0, 0, &lock->user_flock, NULL); - + local = lock->frame->local; + PL_STACK_UNWIND_AND_FREE(local, lk, lock->frame, 0, 0, + &lock->user_flock, NULL); __destroy_lock(lock); } |