diff options
author | Alexander Aring <aahringo@redhat.com> | 2022-08-15 15:43:18 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-08-23 14:49:09 -0500 |
commit | 9ac8ba46a701b863be3f197d7eece4c635d0afe4 (patch) | |
tree | fd7496cfda990f00a8aeed6f8cb6fcb6e69d5715 /fs/dlm | |
parent | c2d76a62d866ae9c03f09ec2a9f9fb266ad586b8 (diff) |
fs: dlm: handle -EINVAL as log_error()
If the user generates -EINVAL it's probably because they are
using DLM incorrectly. Change the log level to make these
errors more visible.
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 | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 026c203ff529..354f79254d62 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -2900,11 +2900,25 @@ static int validate_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb, #endif rv = 0; out: - if (rv) + switch (rv) { + case 0: + break; + case -EINVAL: + /* annoy the user because dlm usage is wrong */ + WARN_ON(1); + log_error(ls, "%s %d %x %x %x %d %d %s", __func__, + rv, lkb->lkb_id, lkb->lkb_flags, args->flags, + lkb->lkb_status, lkb->lkb_wait_type, + lkb->lkb_resource->res_name); + break; + default: log_debug(ls, "%s %d %x %x %x %d %d %s", __func__, rv, lkb->lkb_id, lkb->lkb_flags, args->flags, lkb->lkb_status, lkb->lkb_wait_type, lkb->lkb_resource->res_name); + break; + } + return rv; } @@ -3037,11 +3051,25 @@ static int validate_unlock_args(struct dlm_lkb *lkb, struct dlm_args *args) lkb->lkb_astparam = args->astparam; rv = 0; out: - if (rv) + switch (rv) { + case 0: + break; + case -EINVAL: + /* annoy the user because dlm usage is wrong */ + WARN_ON(1); + log_error(ls, "%s %d %x %x %x %x %d %s", __func__, rv, + lkb->lkb_id, lkb->lkb_flags, lkb->lkb_exflags, + args->flags, lkb->lkb_wait_type, + lkb->lkb_resource->res_name); + break; + default: log_debug(ls, "%s %d %x %x %x %x %d %s", __func__, rv, lkb->lkb_id, lkb->lkb_flags, lkb->lkb_exflags, args->flags, lkb->lkb_wait_type, lkb->lkb_resource->res_name); + break; + } + return rv; } |