Skip to content

Commit

Permalink
dlm: fix missing check in validate_lock_args
Browse files Browse the repository at this point in the history
This patch adds a additional check if lkb->lkb_wait_count is non zero as
it is done in validate_unlock_args() to check if any operation is in
progress. While on it add a comment taken from validate_unlock_args() to
signal what the check is doing.

There might be no changes because if lkb->lkb_wait_type is non zero
implies that lkb->lkb_wait_count is non zero. However we should add the
check as it does validate_unlock_args().

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
  • Loading branch information
Alexander Aring authored and teigland committed Apr 6, 2022
1 parent 1f4f108 commit 67e4d8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/dlm/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -2912,7 +2912,8 @@ static int validate_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb,
if (lkb->lkb_status != DLM_LKSTS_GRANTED)
goto out;

if (lkb->lkb_wait_type)
/* lock not allowed if there's any op in progress */
if (lkb->lkb_wait_type || lkb->lkb_wait_count)
goto out;

if (is_overlap(lkb))
Expand Down

0 comments on commit 67e4d8c

Please sign in to comment.