diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2016-06-22 23:04:53 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2016-06-23 14:55:35 +0200 |
commit | eb51be4fbee95d76b53e5255242a8032c3028aa2 (patch) | |
tree | a2754995d532b686b6f08a959b2314b75ff34f5a | |
parent | af36f5ad369ebf4c1d768145a827436ccef22f63 (diff) | |
download | lvm2-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_NEW | 1 | ||||
-rw-r--r-- | lib/activate/activate.c | 6 |
2 files changed, 5 insertions, 2 deletions
@@ -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; |