summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2013-08-05 22:20:19 +0530
committerAnand Avati <avati@redhat.com>2013-08-17 17:21:46 -0700
commitbb1fb1e1614d2c1646e2d512779d723b66b2a766 (patch)
tree4836360c337137165c15db07577083ce348a4790 /libglusterfs
parent3d509b1b5acfe55d003f0ae9b51486247226e16f (diff)
protocol/server: Relax lktable finodelk del_locker check
Problem: Client xlator issues finodelk using anon-fd when the fd is not opened on the file. This can also happen between attempts to re-open the file after client disconnects. It can so happen that lock is taken using anon-fd and the file is now re-opened and unlock would come with re-opened fd. This will lead to leak in lk-table entry, which also holds reference to fd which leads to fd-leak on the brick. Fix: Don't check for fds to be equal for tracking finodelks. Since inodelk is identified by (gfid, connection, lk-owner) fd equality is not needed. Change-Id: I62152d84caef0b863c973845e618076d388e6848 BUG: 993247 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/5499 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/lock-table.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libglusterfs/src/lock-table.c b/libglusterfs/src/lock-table.c
index a2fff2e3333..42b7ed8a785 100644
--- a/libglusterfs/src/lock-table.c
+++ b/libglusterfs/src/lock-table.c
@@ -97,7 +97,12 @@ gf_del_locker (struct _lock_table *table, const char *volume,
strcmp (locker->volume, volume))
continue;
- if (locker->fd && fd && (locker->fd == fd))
+ /*
+ * It is possible for inodelk lock to come on anon-fd
+ * and inodelk unlock to come on normal fd in case of
+ * client re-opens. So don't check for fds to be equal.
+ */
+ if (locker->fd && fd)
list_move_tail (&locker->lockers, &del);
else if (locker->loc.inode && loc &&
(locker->loc.inode == loc->inode))