summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2020-01-30 12:52:19 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2020-02-04 17:22:06 +0100
commitbcfe4993e577167440be511da4ec879fac19afdb (patch)
tree4c06bdbabb14f9bf2dd307dcf93e9c90b0fb7e7e
parent555d6d4e62b5a10a8f52454a93e3cdc65e0d1abd (diff)
downloadlvm2-bcfe4993e577167440be511da4ec879fac19afdb.tar.gz
lvmlockd: move eval of ENOENT
To avoid logging 'errors' for no real error state (ENOENT), move this evaluation upward in the code.
-rw-r--r--lib/locking/lvmlockd.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index cbe212161..416121011 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2092,7 +2092,8 @@ static int _query_lock_lv(struct cmd_context *cmd, struct volume_group *vg,
log_error("Lock query failed for LV %s/%s", vg->name, lv_name);
return 0;
} else {
- ret = (result < 0) ? 0 : 1;
+ /* ENOENT => The lv was not active/locked. */
+ ret = (result < 0 && (result != -ENOENT)) ? 0 : 1;
}
if (!ret)
@@ -2110,10 +2111,6 @@ static int _query_lock_lv(struct cmd_context *cmd, struct volume_group *vg,
daemon_reply_destroy(reply);
- /* The lv was not active/locked. */
- if (result == -ENOENT)
- return 1;
-
return ret;
}