From b2535d0c971afc665a268cbe55b6d23262e21e2b Mon Sep 17 00:00:00 2001 From: Alasdair G Kergon Date: Mon, 23 Sep 2013 19:53:18 +0100 Subject: [PATCH] pvmove: clean exit on failed pvmove restart At present, before the pvmove command can be used to restart pvmove polling, the LVs concerned need to be activated e.g. with lvchange -ay. --- WHATS_NEW | 1 + tools/polldaemon.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index ff0303af7..8c1a34333 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.103 - ====================================== + Exit cleanly with message when pvmove cannot restart because LV is inactive. Version 2.02.102 - 23rd September 2013 ====================================== diff --git a/tools/polldaemon.c b/tools/polldaemon.c index 0b00e9352..7eeea2cb6 100644 --- a/tools/polldaemon.c +++ b/tools/polldaemon.c @@ -201,7 +201,12 @@ static int _poll_vg(struct cmd_context *cmd, const char *vgname, continue; /* FIXME Need to do the activation from _set_up_pvmove here - * if it's not running and we're not aborting */ + * if it's not running and we're not aborting. */ + if (!lv_is_active(lv)) { + log_print_unless_silent("%s: Skipping inactive LV. Try lvchange or vgchange.", name); + continue; + } + if (_check_lv_status(cmd, vg, lv, name, parms, &finished) && !finished) parms->outstanding_count++;