diff options
author | Milan Broz <mbroz@redhat.com> | 2010-08-23 11:34:10 +0000 |
---|---|---|
committer | Milan Broz <mbroz@redhat.com> | 2010-08-23 11:34:10 +0000 |
commit | cf704d22b6f136c9bc8037871a7967652ebca87b (patch) | |
tree | d28c667abefc2d820753eab58d581c2b8df97679 /tools/pvmove.c | |
parent | 9c179ef4187496005e5f8b56017eb788e2262d72 (diff) | |
download | lvm2-cf704d22b6f136c9bc8037871a7967652ebca87b.tar.gz lvm2-cf704d22b6f136c9bc8037871a7967652ebca87b.tar.xz lvm2-cf704d22b6f136c9bc8037871a7967652ebca87b.zip |
Fix pvmove --abort to work even for empty pvmove LV
If pvmove crashed and metadata contains pvmove LV
but without miorrored segments, pvmove --abort
will not repair the situation (and finish wth success!).
Fix it by allowing metadata update if aborting
(thus removing pvmove LV) even if no moved LVs detected.
(Tested on real metadata provided by an lvm user:-)
Diffstat (limited to 'tools/pvmove.c')
-rw-r--r-- | tools/pvmove.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/pvmove.c b/tools/pvmove.c index c8a480fd..0346ca34 100644 --- a/tools/pvmove.c +++ b/tools/pvmove.c @@ -520,7 +520,8 @@ static int _finish_pvmove(struct cmd_context *cmd, struct volume_group *vg, { int r = 1; - if (!_detach_pvmove_mirror(cmd, lv_mirr)) { + if (!dm_list_empty(lvs_changed) && + !_detach_pvmove_mirror(cmd, lv_mirr)) { log_error("ABORTING: Removal of temporary mirror failed"); return 0; } |