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

metadata: format_text: provide more detailed error message when metadata too large for PV mda

Also, leave out the note about "circular buffer" which is
an internal imeplementation detail anyway and not quite
informational for users:

Before this patch:
$ vgcreate vg1 /dev/sda
  VG vg1 metadata too large for circular buffer
  Failed to write VG vg1.

With this patch applied:
$ vgcreate vg1 /dev/sda
  VG vg1 metadata too large: size of metadata to write is 691 bytes while PV metadata area size on /dev/sda is 512 bytes.
  Failed to write VG vg1.
This commit is contained in:
Peter Rajnoha 2015-10-08 16:25:10 +02:00
parent e04424e87e
commit 3d03e504cd

View File

@ -655,8 +655,11 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) || if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) || (rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
(mdac->rlocn.size >= mdah->size)) { (mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer", log_error("VG %s metadata too large: size of metadata to write "
vg->name); "is %" PRIu64 " bytes while PV metadata area size "
"on %s is %" PRIu64 " bytes.",
vg->name, mdac->rlocn.size,
dev_name(mdac->area.dev), mdah->size);
goto out; goto out;
} }