1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Start background polling of merging stores on:

- lvchange -ay or vgchange -ay.
- lvchange --refresh or vgchange --refresh.
This commit is contained in:
Mike Snitzer 2010-01-13 01:50:34 +00:00
parent a0be44c727
commit df06d9ac7a
2 changed files with 21 additions and 8 deletions

View File

@ -1261,6 +1261,18 @@ int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)
if (!r) if (!r)
goto_out; goto_out;
/*
* check if snapshot merge should be polled
* - unfortunately: even though the dev_manager will clear
* the lv's merge attributes if a merge is not possible;
* it is clearing a different instance of the lv (as
* retrieved with lv_from_lvid)
* - fortunately: polldaemon will immediately shutdown if the
* origin doesn't have a status with a snapshot percentage
*/
if (background_polling() && lv_is_origin(lv) && lv->merging_snapshot)
lv_spawn_background_polling(cmd, lv);
out: out:
return r; return r;
} }
@ -1295,7 +1307,7 @@ void lv_spawn_background_polling(struct cmd_context *cmd,
pvmove_poll(cmd, pvname, 1); pvmove_poll(cmd, pvname, 1);
} }
if (lv->status & CONVERTING) { if (lv->status & CONVERTING || lv->merging_snapshot) {
log_verbose("Spawning background lvconvert process for %s", log_verbose("Spawning background lvconvert process for %s",
lv->name); lv->name);
lvconvert_poll(cmd, lv, 1); lvconvert_poll(cmd, lv, 1);

View File

@ -68,13 +68,13 @@ static int _poll_lvs_in_vg(struct cmd_context *cmd,
else else
lv_active = info.exists; lv_active = info.exists;
if (!lv_active || if (lv_active &&
!(lv->status & (PVMOVE|CONVERTING))) (lv->status & (PVMOVE|CONVERTING) ||
continue; lv->merging_snapshot)) {
lv_spawn_background_polling(cmd, lv); lv_spawn_background_polling(cmd, lv);
count++; count++;
} }
}
/* /*
* returns the number of polled devices * returns the number of polled devices
@ -140,7 +140,8 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd,
if (background_polling() && if (background_polling() &&
activate != CHANGE_AN && activate != CHANGE_ALN && activate != CHANGE_AN && activate != CHANGE_ALN &&
(lv->status & (PVMOVE|CONVERTING))) (lv->status & (PVMOVE|CONVERTING) ||
lv->merging_snapshot))
lv_spawn_background_polling(cmd, lv); lv_spawn_background_polling(cmd, lv);
count++; count++;