]> sourceware.org Git - lvm2.git/commitdiff
Add warning to vgextend and pvchange if metadataignore given on cmdline.
authorDave Wysochanski <dwysocha@redhat.com>
Wed, 7 Jul 2010 18:59:45 +0000 (18:59 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Wed, 7 Jul 2010 18:59:45 +0000 (18:59 +0000)
Warn the user then change the value of vg_mda_copies.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
lib/metadata/metadata.c
tools/vgextend.c

index 543ad83089c2140d691e653fcfc9b5ea9c6df920..c322e1d04645fbce623b0862feb464de3a0e6523 100644 (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;
 }
index 6d06c19fd36bd54f98d6d3529e67cd387c3d03a9..9c30184d56eb426e02d07544891bbfc53da23d2e 100644 (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);
This page took 0.042713 seconds and 5 git commands to generate.