From 30c94b0324f070ea3e8b746745572580fc8e0667 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Thu, 20 Sep 2018 13:53:50 -0500 Subject: [PATCH] metadata: remove an unused and incorrect overflow check Remove another instance of an invalid check for metadata overflow during read. The previous instance was removed in commit 5fb15b193. This was checking for metadata that that overflowed the circular disk metadata buffer during read, but such metadata cannot be written, so it shouldn't be possible to find see. Also, the check was incorrect and could trigger when there was no overflow. --- lib/format_text/format-text.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index 7857091fe..04a3a8d48 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -567,14 +567,6 @@ static struct volume_group *_vg_read_raw_area(struct format_instance *fid, if (rlocn->offset + rlocn->size > mdah->size) wrap = (uint32_t) ((rlocn->offset + rlocn->size) - mdah->size); - if (wrap > rlocn->offset) { - log_error("Metadata for VG %s on %s at %llu size %llu is too large for circular buffer.", - vgname, dev_name(area->dev), - (unsigned long long)(area->start + rlocn->offset), - (unsigned long long)rlocn->size); - goto out; - } - vg = text_read_metadata(fid, NULL, vg_fmtdata, use_previous_vg, area->dev, primary_mda, (off_t) (area->start + rlocn->offset), (uint32_t) (rlocn->size - wrap), -- 2.43.5