summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2020-03-02 15:22:39 -0600
committerDavid Teigland <teigland@redhat.com>2020-03-03 13:47:07 -0600
commitf140620043eb22b192e7d87e17a42fcd0a3656a1 (patch)
treee901c624ed187f162d84265c6dc879e580cad7f3
parentc6746181a3c2c40447f5a33e15359b57567f8217 (diff)
downloadlvm2-f140620043eb22b192e7d87e17a42fcd0a3656a1.tar.gz
pvck: fix reading large mda1
When mda_size is larger than io_memory_size, reading the entire mda fails unless the previous read of the label has been invalidated.
-rw-r--r--tools/pvck.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/pvck.c b/tools/pvck.c
index ab8553796..79e3af5c3 100644
--- a/tools/pvck.c
+++ b/tools/pvck.c
@@ -981,6 +981,13 @@ static int _dump_label_and_pv_header(struct cmd_context *cmd, uint64_t labelsect
return 0;
}
+ /*
+ * Not invalidating this range can cause an error reading
+ * a larger range that overlaps this.
+ */
+ if (!dev_invalidate_bytes(dev, lh_offset, 512))
+ stack;
+
lh = (struct label_header *)buf;
if (print_fields) {