summaryrefslogtreecommitdiff
path: root/tools/polldaemon.c
diff options
context:
space:
mode:
authorOndrej Kozina <okozina@redhat.com>2015-10-19 16:56:45 +0200
committerOndrej Kozina <okozina@redhat.com>2015-10-20 12:18:55 +0200
commit33465066c5eddaa6169814d645d543e5673bc2a6 (patch)
tree4a98c52fe2894443c301d50c27b4166508d20f9d /tools/polldaemon.c
parenta5c4c4efbd18809320f49d7ed60c58883140259c (diff)
downloadlvm2-33465066c5eddaa6169814d645d543e5673bc2a6.tar.gz
polldaemon: fix missing mirror in-sync info with lvmpolld
CONVERTING status flag is a tricky one. It's not set when converting a non-mirror LV type to the mirror type, i.e.: linear -> two leg mirror. Also the conversion itself is instant and doesn't require to be polled. When mirror reaches sync state there's no final update on VG metadata for lvmpolld to be made thereby report_progress in fact doesn't report percentage of mirror being converted but percentage of mirror being in sync. Perhaps we should reword the lvconvert output here. On the other hand CONVERTING is set while we upconvert the mirror from i.e. two leg mirror to four leg mirror. In such case the operation is required to be polled so that lvmpolld can cleanup temporary conversion log when the conversion is over. Ignore CONVERTING lv_type for the moment and match LVs only by uuids during 'mirror conversion'/'waiting for a sync to finish'.
Diffstat (limited to 'tools/polldaemon.c')
-rw-r--r--tools/polldaemon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/polldaemon.c b/tools/polldaemon.c
index cee1983f2..ccfaa7d71 100644
--- a/tools/polldaemon.c
+++ b/tools/polldaemon.c
@@ -412,7 +412,12 @@ static int report_progress(struct cmd_context *cmd, struct poll_operation_id *id
if (lv && id->uuid && strcmp(id->uuid, (char *)&lv->lvid))
lv = NULL;
- if (lv && parms->lv_type && !(lv->status & parms->lv_type))
+
+ /*
+ * CONVERTING is set only during mirror upconversion but we may need to
+ * read LV's progress info even when it's not converting (linear->mirror)
+ */
+ if (lv && (parms->lv_type ^ CONVERTING) && !(lv->status & parms->lv_type))
lv = NULL;
if (!lv) {