From 0d33cce6f7bbb71abe0086469f2f726151b0e62c Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Sun, 22 Aug 2010 14:09:48 +0000 Subject: protocol/server: features/locks: Fix nonblocking entrylks, inodelks in locks and server. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Anand V. Avati BUG: 960 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=960 --- xlators/features/locks/src/inodelk.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'xlators/features/locks/src/inodelk.c') diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index 592d14e0876..eaae8d4deed 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -130,13 +130,8 @@ static int same_inodelk_owner (pl_inode_lock_t *l1, pl_inode_lock_t *l2) static int inodelk_conflict (pl_inode_lock_t *l1, pl_inode_lock_t *l2) { - if (same_inodelk_owner (l1, l2)) - return 0; - - if (!inodelk_overlap (l1, l2)) - return 0; - - return (inodelk_type_conflict(l1, l2)); + return (inodelk_overlap (l1, l2) && + inodelk_type_conflict (l1, l2)); } /* Determine if lock is grantable or not */ @@ -271,7 +266,8 @@ find_matching_inodelk (pl_inode_lock_t *lock, pl_dom_list_t *dom) { pl_inode_lock_t *l = NULL; list_for_each_entry (l, &dom->inodelk_list, list) { - if (inodelks_equal (l, lock)) + if (inodelks_equal (l, lock) && + same_inodelk_owner (l, lock)) return l; } return NULL; @@ -582,7 +578,7 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this, dom = get_domain (pinode, volume); - if (client_pid == 0) { + if (owner == 0) { /* special case: this means release all locks from this transport @@ -604,6 +600,9 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this, goto unwind; } + reqlock->frame = frame; + reqlock->this = this; + switch (cmd) { case F_SETLKW: can_block = 1; -- cgit