From 64b28e0839f6cbe88002c6c909b224b95c594d5a Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 13 Jul 2023 21:24:26 +0200 Subject: [PATCH] lvchange: add log_error for failure path When change of monitoring fails, ensure there is log_error() printed. --- tools/lvchange.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/lvchange.c b/tools/lvchange.c index db63eb9ea..bd120bf0a 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -156,8 +156,11 @@ static int _lvchange_monitoring(struct cmd_context *cmd, log_verbose("Monitoring LV %s", display_lvname(lv)); else log_verbose("Unmonitoring LV %s", display_lvname(lv)); - if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode())) - return_0; + if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode())) { + log_error("Failed to change monitoring for %s volume.", + display_lvname(lv)); + return 0; + } } return 1;