mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Also allow pvmove --abort when pvmove mirror not active (e.g. after a reboot).
This commit is contained in:
parent
28cb0299c1
commit
36cf79384f
@ -483,6 +483,16 @@ static int _check_pvmove_status(struct cmd_context *cmd,
|
||||
|
||||
*finished = 1;
|
||||
|
||||
if (parms->aborting) {
|
||||
if (!(lvs_changed = lvs_using_lv(cmd, vg, lv_mirr))) {
|
||||
log_error("Failed to generate list of moved LVs: "
|
||||
"can't abort.");
|
||||
return 0;
|
||||
}
|
||||
_finish_pvmove(cmd, vg, lv_mirr, lvs_changed);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!lv_mirror_percent(lv_mirr, !parms->interval, &segment_percent,
|
||||
&event_nr)) {
|
||||
log_error("ABORTING: Mirror percentage check failed.");
|
||||
@ -495,7 +505,7 @@ static int _check_pvmove_status(struct cmd_context *cmd,
|
||||
else
|
||||
log_verbose("%s: Moved: %.1f%%", pv_name, overall_percent);
|
||||
|
||||
if (segment_percent < 100.0 && !parms->aborting) {
|
||||
if (segment_percent < 100.0) {
|
||||
*finished = 0;
|
||||
return 1;
|
||||
}
|
||||
@ -505,11 +515,6 @@ static int _check_pvmove_status(struct cmd_context *cmd,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (parms->aborting) {
|
||||
_finish_pvmove(cmd, vg, lv_mirr, lvs_changed);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (overall_percent >= 100.0) {
|
||||
if (!_finish_pvmove(cmd, vg, lv_mirr, lvs_changed))
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user