diff options
author | Alexander Aring | 2022-04-04 16:06:29 -0400 |
---|---|---|
committer | David Teigland | 2022-04-06 14:01:49 -0500 |
commit | 67e4d8c51dc6e1cc1c2e559ed6fcf9ea1bca654a (patch) | |
tree | deb640eb9afed2285c871e0aac02a118c414e461 /fs/dlm | |
parent | 1f4f10845e14690b02410de50d9ea9684625a4ae (diff) |
dlm: fix missing check in validate_lock_args
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>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/lock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index bdb51d209ba2..e72f1a063aeb 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -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)) |