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

lvscan: Make --cache impervious to already-missing devices.

This commit is contained in:
Petr Rockai 2014-08-04 17:02:26 +02:00
parent 03a88da868
commit 0208665209

View File

@ -19,6 +19,7 @@ static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume
{
struct pv_list *pvl;
struct dm_list pvs;
char pvid_s[64];
if (!lvmetad_used()) {
log_verbose("Ignoring lvscan --cache because lvmetad is not in use.");
@ -30,9 +31,16 @@ static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct logical_volume
if (!get_pv_list_for_lv(lv->vg->vgmem, lv, &pvs))
return ECMD_FAILED;
dm_list_iterate_items(pvl, &pvs)
dm_list_iterate_items(pvl, &pvs) {
if (!pvl->pv->dev) {
id_write_format(&pvl->pv->id, pvid_s, sizeof(pvid_s));
log_warn("WARNING: Device for PV %s already missing, skipping.",
pvid_s);
continue;
}
if (!lvmetad_pvscan_single(cmd, pvl->pv->dev, NULL))
return ECMD_FAILED;
}
return ECMD_PROCESSED;
}