1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

format_text: Log additional circular buffer information.

This commit is contained in:
Alasdair G Kergon 2017-12-11 15:59:40 +00:00
parent 49d486319f
commit 46393bfca0

View File

@ -541,8 +541,8 @@ static struct volume_group *_vg_read_raw_area(struct format_instance *fid,
wrap = (uint32_t) ((rlocn->offset + rlocn->size) - mdah->size);
if (wrap > rlocn->offset) {
log_error("VG %s metadata too large for circular buffer",
vgname);
log_error("VG %s metadata on %s (" FMTu64 " bytes) too large for circular buffer (" FMTu64 " bytes)",
vgname, dev_name(area->dev), rlocn->size, mdah->size - MDA_HEADER_SIZE);
goto out;
}
@ -672,14 +672,14 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
if ((new_wrap && old_wrap) ||
(rlocn && (new_wrap || old_wrap) && (new_end > rlocn->offset)) ||
(MDA_HEADER_SIZE + (rlocn ? rlocn->size : 0) + mdac->rlocn.size >= mdah->size)) {
log_error("VG %s metadata too large for circular buffer",
vg->name);
log_error("VG %s metadata on %s (" FMTu64 " bytes) too large for circular buffer (" FMTu64 " bytes with " FMTu64 " used)",
vg->name, dev_name(mdac->area.dev), mdac->rlocn.size, mdah->size - MDA_HEADER_SIZE, rlocn ? rlocn->size : 0);
goto out;
}
log_debug_metadata("Writing %s metadata to %s at " FMTu64 " len " FMTu64,
log_debug_metadata("Writing %s metadata to %s at " FMTu64 " len " FMTu64 " of " FMTu64,
vg->name, dev_name(mdac->area.dev), mdac->area.start +
mdac->rlocn.offset, mdac->rlocn.size - new_wrap);
mdac->rlocn.offset, mdac->rlocn.size - new_wrap, mdac->rlocn.size);
/* Write text out, circularly */
if (!dev_write(mdac->area.dev, mdac->area.start + mdac->rlocn.offset,
@ -688,9 +688,9 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg,
goto_out;
if (new_wrap) {
log_debug_metadata("Writing wrapped metadata to %s at " FMTu64 " len " FMTu64,
log_debug_metadata("Writing wrapped metadata to %s at " FMTu64 " len " FMTu64 " of " FMTu64,
dev_name(mdac->area.dev), mdac->area.start +
MDA_HEADER_SIZE, new_wrap);
MDA_HEADER_SIZE, new_wrap, mdac->rlocn.size);
if (!dev_write(mdac->area.dev, mdac->area.start + MDA_HEADER_SIZE,
(size_t) new_wrap, MDA_CONTENT_REASON(mda_is_primary(mda)),
@ -1228,8 +1228,8 @@ int vgname_from_mda(const struct format_type *fmt,
wrap = (uint32_t) ((rlocn->offset + rlocn->size) - mdah->size);
if (wrap > rlocn->offset) {
log_error("%s: metadata too large for circular buffer",
dev_name(dev_area->dev));
log_error("%s: metadata (" FMTu64 " bytes) too large for circular buffer (" FMTu64 " bytes)",
dev_name(dev_area->dev), rlocn->size, mdah->size - MDA_HEADER_SIZE);
return 0;
}