[lvm-devel] [PATCH 25/35] Make vg->mda_copies persistent in on disk vg metadata.
Zdenek Kabelac
zkabelac at redhat.com
Tue Jun 22 08:18:56 UTC 2010
Dne 22.6.2010 05:05, Dave Wysochanski napsal(a):
> This patch adds the ability to read/write the vg->mda_copies values
> from/to the vg metadata.
>
> If we read the VG metadata and this field does not exist, we set
> mda_copies to the default value of 0. Later in the code, we use
> this special '0' value to indicate a disable of metadata balancing.
> This should preserve existing LVM behavior and ensure metadata balancing
> can be turned off should the need arise.
>
> Signed-off-by: Dave Wysochanski<dwysocha at redhat.com>
> ---
> lib/format_text/export.c | 1 +
> lib/format_text/import_vsn1.c | 5 +++++
> 2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/lib/format_text/export.c b/lib/format_text/export.c
> index 5f02b5d..52ae11c 100644
> --- a/lib/format_text/export.c
> +++ b/lib/format_text/export.c
> @@ -397,6 +397,7 @@ static int _print_vg(struct formatter *f, struct volume_group *vg)
> outf(f, "allocation_policy = \"%s\"",
> get_alloc_string(vg->alloc));
> }
> + outf(f, "metadata_copies = %u", vg->mda_copies);
>
> return 1;
Hmm - so we add a new element to the metadata format with the same version
number? If the user will update metadata with older tools which do not know
about this parameter - will he get at least a warning that he will miss some
information ?
Zdenek
More information about the lvm-devel
mailing list