1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add warning to vgextend and pvchange if metadataignore given on cmdline.

Warn the user then change the value of vg_mda_copies.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Dave Wysochanski 2010-07-07 18:59:45 +00:00
parent 05d2c210e1
commit 7041b476ac
2 changed files with 15 additions and 1 deletions

View File

@ -4396,8 +4396,13 @@ int pv_change_metadataignore(struct physical_volume *pv, uint32_t mda_ignored)
* This does not guarantee this PV's ignore bits will be
* preserved in future operations.
*/
if (!is_orphan(pv) && vg_mda_copies(pv->vg))
if (!is_orphan(pv) &&
vg_mda_copies(pv->vg) != VGMETADATACOPIES_UNMANAGED) {
log_warn("WARNING: Changing preferred number of copies of VG %s "
"metadata from %"PRIu32" to %"PRIu32, pv_vg_name(pv),
vg_mda_copies(pv->vg), vg_mda_used_count(pv->vg));
vg_set_mda_copies(pv->vg, vg_mda_used_count(pv->vg));
}
return 1;
}

View File

@ -63,6 +63,15 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
if (!vg_extend(vg, argc, argv, &pp))
goto_bad;
if (arg_count(cmd, metadataignore_ARG) &&
(vg_mda_copies(vg) != VGMETADATACOPIES_UNMANAGED) &&
(vg_mda_copies(vg) != vg_mda_used_count(vg))) {
log_warn("WARNING: Changing preferred number of copies of VG %s "
"metadata from %"PRIu32" to %"PRIu32, vg_name,
vg_mda_copies(vg), vg_mda_used_count(vg));
vg_set_mda_copies(vg, vg_mda_used_count(vg));
}
/* ret > 0 */
log_verbose("Volume group \"%s\" will be extended by %d new "
"physical volumes", vg_name, argc);