mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
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>).
This commit is contained in:
parent
af36f5ad36
commit
eb51be4fbe
@ -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.
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user