Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
Version 2.02.54 -
=====================================
+ Don't attempt to restart pvmoves when deactivating LVs in vgchange.
+ Restart lvconverts in vgchange by sharing lv_spawn_background_polling.
Generalise polldaemon code by changing mirror-specific variable names.
Don't attempt to deactivate an LV if any of its snapshots are in use.
Return fail if lv_deactivate fails to remove device from kernel.
struct logical_volume *lv)
{
int activate;
- const char *pvname;
activate = arg_uint_value(cmd, available_ARG, 0);
return_0;
}
- if ((lv->status & LOCKED) &&
- (pvname = get_pvmove_pvname_from_lv(lv))) {
- log_verbose("Spawning background pvmove process for %s",
- pvname);
- pvmove_poll(cmd, pvname, 1);
- }
-
- if (lv->status & CONVERTING) {
- log_verbose("Spawning background lvconvert process for %s",
- lv->name);
- lvconvert_poll(cmd, lv, 1);
- }
+ lv_spawn_background_polling(cmd, lv);
}
return 1;
return r;
}
+
+void lv_spawn_background_polling(struct cmd_context *cmd,
+ struct logical_volume *lv)
+{
+ const char *pvname;
+
+ if ((lv->status & LOCKED) &&
+ (pvname = get_pvmove_pvname_from_lv(lv))) {
+ log_verbose("Spawning background pvmove process for %s",
+ pvname);
+ pvmove_poll(cmd, pvname, 1);
+ }
+
+ if (lv->status & CONVERTING) {
+ log_verbose("Spawning background lvconvert process for %s",
+ lv->name);
+ lvconvert_poll(cmd, lv, 1);
+ }
+}
int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv);
int vg_refresh_visible(struct cmd_context *cmd, struct volume_group *vg);
+void lv_spawn_background_polling(struct cmd_context *cmd,
+ struct logical_volume *lv);
+
#endif
} else if (!activate_lv(cmd, lv))
continue;
- if ((lv->status & PVMOVE) &&
- (pvname = get_pvmove_pvname_from_lv_mirr(lv))) {
- log_verbose("Spawning background process for %s %s",
- lv->name, pvname);
- pvmove_poll(cmd, pvname, 1);
- continue;
- }
+ if (activate != CHANGE_AN && activate != CHANGE_ALN &&
+ (lv->status & (PVMOVE|CONVERTING)))
+ lv_spawn_background_polling(cmd, lv);
count++;
}