Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: only spit out the parent or ref root for ref mismatches
@ 2020-11-19 15:42 Josef Bacik
  2020-12-11 16:32 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Josef Bacik @ 2020-11-19 15:42 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

While debugging some corruption, I got confused because it appeared as
if we had an invalid parent set on a extent reference, because of this
message

tree backref 67014213632 parent 5 root 5 not found in extent tree

But it turns out that parent and the root are a union, and we were just
printing it out regardless of the type of backref it was.  Fix the error
message to be consistent with the other mismatch messages, simply print
parent or root, depending on the ref type.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 check/main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/check/main.c b/check/main.c
index 69a47b31..345f86b1 100644
--- a/check/main.c
+++ b/check/main.c
@@ -3936,9 +3936,12 @@ static int all_backpointers_checked(struct extent_record *rec, int print_errs)
 			} else {
 				tback = to_tree_backref(back);
 				fprintf(stderr,
-"tree backref %llu parent %llu root %llu not found in extent tree\n",
+"tree backref %llu %s %llu not found in extent tree\n",
 					(unsigned long long)rec->start,
-					(unsigned long long)tback->parent,
+					back->full_backref ?
+					"parent" : "root",
+					back->full_backref ?
+					(unsigned long long)tback->parent :
 					(unsigned long long)tback->root);
 			}
 		}
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-11 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-19 15:42 [PATCH] btrfs-progs: only spit out the parent or ref root for ref mismatches Josef Bacik
2020-12-11 16:32 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox