summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-06-22 23:04:53 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-06-23 14:55:35 +0200
commiteb51be4fbee95d76b53e5255242a8032c3028aa2 (patch)
treea2754995d532b686b6f08a959b2314b75ff34f5a
parentaf36f5ad369ebf4c1d768145a827436ccef22f63 (diff)
downloadlvm2-eb51be4fbee95d76b53e5255242a8032c3028aa2.tar.gz
activation: _lv_active returns 0 on error
We have only 2 users of _lv_active() - one was already checking for ==1 while the other use (_lv_is_active()) could have take '-1' as a sign of having an LV active. So return 0 and log_debug also the reason while detection has failed (i.e. in case --driverload n - it's kind of expectable, but might have confused user seeing just <backtrace>).
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/activate/activate.c6
2 files changed, 5 insertions, 2 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 6788e6a84..7cd46d11f 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.158 -
=================================
+ Rerurn 0 (inactive) when status cannot be queried in _lv_active().
Switch to log_warn() for failing activation status query.
Refactor lvconvert argument handling code.
Add --logonly option to report only cmd log for a command, not other reports.
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 8892a2a12..7f5d36f4f 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1266,8 +1266,10 @@ static int _lv_active(struct cmd_context *cmd, const struct logical_volume *lv)
struct lvinfo info;
if (!lv_info(cmd, lv, 0, &info, 0, 0)) {
- stack;
- return -1;
+ log_debug("Cannot determine activation status of %s%s.",
+ display_lvname(lv),
+ activation() ? "" : " (no device driver)");
+ return 0;
}
return info.exists;