mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
metadata: When outdated PVs are wiped, notify lvmetad about the fact.
This commit is contained in:
parent
c78b6f18d4
commit
632dde0cbc
16
lib/cache/lvmetad.c
vendored
16
lib/cache/lvmetad.c
vendored
@ -1161,3 +1161,19 @@ int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handl
|
|||||||
{
|
{
|
||||||
return _lvmetad_pvscan_all_devs(cmd, handler, 1);
|
return _lvmetad_pvscan_all_devs(cmd, handler, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int lvmetad_vg_clear_outdated_pvs(struct volume_group *vg)
|
||||||
|
{
|
||||||
|
char uuid[64];
|
||||||
|
daemon_reply reply;
|
||||||
|
int result;
|
||||||
|
|
||||||
|
if (!id_write_format(&vg->id, uuid, sizeof(uuid)))
|
||||||
|
return_0;
|
||||||
|
|
||||||
|
reply = _lvmetad_send("vg_clear_outdated_pvs", "vgid = %s", uuid, NULL);
|
||||||
|
result = _lvmetad_handle_reply(reply, "clear the list of outdated PVs", vg->name, NULL);
|
||||||
|
daemon_reply_destroy(reply);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
3
lib/cache/lvmetad.h
vendored
3
lib/cache/lvmetad.h
vendored
@ -166,6 +166,8 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev,
|
|||||||
int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler);
|
int lvmetad_pvscan_all_devs(struct cmd_context *cmd, activation_handler handler);
|
||||||
int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handler);
|
int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handler);
|
||||||
|
|
||||||
|
int lvmetad_vg_clear_outdated_pvs(struct volume_group *vg);
|
||||||
|
|
||||||
# else /* LVMETAD_SUPPORT */
|
# else /* LVMETAD_SUPPORT */
|
||||||
|
|
||||||
# define lvmetad_init(cmd) do { } while (0)
|
# define lvmetad_init(cmd) do { } while (0)
|
||||||
@ -192,6 +194,7 @@ int lvmetad_pvscan_foreign_vgs(struct cmd_context *cmd, activation_handler handl
|
|||||||
# define lvmetad_pvscan_single(cmd, dev, handler, ignore_obsolete) (0)
|
# define lvmetad_pvscan_single(cmd, dev, handler, ignore_obsolete) (0)
|
||||||
# define lvmetad_pvscan_all_devs(cmd, handler) (0)
|
# define lvmetad_pvscan_all_devs(cmd, handler) (0)
|
||||||
# define lvmetad_pvscan_foreign_vgs(cmd, handler) (0)
|
# define lvmetad_pvscan_foreign_vgs(cmd, handler) (0)
|
||||||
|
# define lvmetad_vg_clear_outdated_pvs(vg) (1)
|
||||||
|
|
||||||
# endif /* LVMETAD_SUPPORT */
|
# endif /* LVMETAD_SUPPORT */
|
||||||
|
|
||||||
|
@ -3307,9 +3307,11 @@ static struct volume_group *_vg_read(struct cmd_context *cmd,
|
|||||||
*consistent = _repair_inconsistent_vg(correct_vg);
|
*consistent = _repair_inconsistent_vg(correct_vg);
|
||||||
else
|
else
|
||||||
*consistent = !reappeared;
|
*consistent = !reappeared;
|
||||||
if (_wipe_outdated_pvs(cmd, correct_vg, &correct_vg->pvs_outdated))
|
if (_wipe_outdated_pvs(cmd, correct_vg, &correct_vg->pvs_outdated)) {
|
||||||
/* clear the list */
|
/* clear the list */
|
||||||
dm_list_init(&correct_vg->pvs_outdated);
|
dm_list_init(&correct_vg->pvs_outdated);
|
||||||
|
lvmetad_vg_clear_outdated_pvs(correct_vg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return correct_vg;
|
return correct_vg;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user