summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmds-check.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 4083298f..68cdd523 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -1637,6 +1637,14 @@ static int check_root_refs(struct btrfs_root *root,
rec->objectid);
if (ret == 0)
continue;
+
+ /*
+ * If we don't have a root item then we likely just have
+ * a dir item in a snapshot for this root but no actual
+ * ref key or anything so it's meaningless.
+ */
+ if (!rec->found_root_item)
+ continue;
errors++;
fprintf(stderr, "fs tree %llu not referenced\n",
(unsigned long long)rec->objectid);