]> sourceware.org Git - lvm2.git/commitdiff
Fix pvmove --abort to work even for empty pvmove LV
authorMilan Broz <mbroz@redhat.com>
Mon, 23 Aug 2010 11:34:10 +0000 (11:34 +0000)
committerMilan Broz <mbroz@redhat.com>
Mon, 23 Aug 2010 11:34:10 +0000 (11:34 +0000)
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:-)

WHATS_NEW
tools/polldaemon.c
tools/pvmove.c

index f3f1d27af66a9ccad47cfd1dc9e2664c9628e931..04c362b730ab013835b9ef6fdef8b5cae9d02c2f 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.74 - 
 ==================================
+  Fix pvmove --abort to remove even for empty pvmove LV.
   Add configure --with-default-data-alignment.
   Update heuristic used for default and detected data alignment.
   Add "devices/default_data_alignment" to lvm.conf.
index d51f4bb1c1a009d9c484021d9addf9558623c2ac..147d5320db9226cdfae92325df62f59e724b1b4e 100644 (file)
@@ -234,8 +234,10 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname,
                lv = lvl->lv;
                if (!(lv->status & parms->lv_type))
                        continue;
-               if (!(name = parms->poll_fns->get_copy_name_from_lv(lv)))
+               name = parms->poll_fns->get_copy_name_from_lv(lv);
+               if (!name && !parms->aborting)
                        continue;
+
                /* FIXME Need to do the activation from _set_up_pvmove here
                 *       if it's not running and we're not aborting */
                if (_check_lv_status(cmd, vg, lv, name, parms, &finished) &&
index c8a480fdd4f575d5fe01b0de0b3aff19a198872d..0346ca34758d5ac4e00145525c5cc8c8d1df117b 100644 (file)
@@ -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;
        }
This page took 0.047671 seconds and 5 git commands to generate.