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; }