Skip to contentSkip to conversation

master - pvck: fix looping dump metadata_all

PATCH David Teigland 1 participant 1 message Jul 12, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=76573137404dafa58795995f5c10dfb5dbc714de
Commit:        76573137404dafa58795995f5c10dfb5dbc714de
Parent:        7230aa891c4186ab425f6821c25101d9049fadde
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Jul 12 12:21:27 2019 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Jul 12 14:09:06 2019 -0500

pvck: fix looping dump metadata_all

dump metadata_all wouldn't quit if the metadata wrapped.

---
 tools/pvck.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
tools/pvck.c +3 -0
index 3437164..af2dd8e 100644
@@ -395,6 +395,9 @@ static int _dump_meta_all(struct device *dev, const char *tofile,
 	search_offset = meta_offset + meta_size;
 
  search_next:
+	if (search_wrapped && (search_offset >= meta_offset + meta_size))
+		goto done;
+
 	if (search_offset > mda_size) {
 		if (search_wrapped)
 			goto done;