diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2011-02-25 14:08:54 +0000 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2011-02-25 14:08:54 +0000 |
commit | 4a304dc1d8a8510f57f8a9ecd447e07f4a792fbd (patch) | |
tree | e159d95ded033c5431d7a4a1037500d4bc50cb22 /lib/format_text/format-text.c | |
parent | f74bd57ec951eb933a835d1c340133ab09e9d922 (diff) | |
download | lvm2-4a304dc1d8a8510f57f8a9ecd447e07f4a792fbd.tar.gz lvm2-4a304dc1d8a8510f57f8a9ecd447e07f4a792fbd.tar.xz lvm2-4a304dc1d8a8510f57f8a9ecd447e07f4a792fbd.zip |
Allow only orphan PVs to be resized even with two metadata areas.
Diffstat (limited to 'lib/format_text/format-text.c')
-rw-r--r-- | lib/format_text/format-text.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 78f9ff9f..703477c1 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -2161,6 +2161,17 @@ static int _text_pv_resize(const struct format_type *fmt, /* If there's an mda at the end, move it to a new position. */ if ((mda = fid_get_mda_indexed(fid, pvid, ID_LEN, 1)) && (mdac = mda->metadata_locn)) { + /* + * FIXME: Remove this restriction - we need to + * allow writing PV labels on non-orphan VGs + * for this to work correctly. + */ + if (vg) { + log_error("Resizing a PV with two metadata areas " + "that is part of a VG is not supported."); + return 0; + } + /* FIXME: Maybe MDA0 size would be better? */ mda_size = mdac->area.size >> SECTOR_SHIFT; mda_ignored = mda_is_ignored(mda); |