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:
parent
05d2c210e1
commit
7041b476ac
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user