summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--check/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/check/main.c b/check/main.c
index 3de997e4..40056f50 100644
--- a/check/main.c
+++ b/check/main.c
@@ -4051,6 +4051,11 @@ static int try_to_fix_bad_block(struct btrfs_root *root,
btrfs_init_path(&path);
ULIST_ITER_INIT(&iter);
+ /*
+ * If we found no roots referrening to this tree block, there is no
+ * chance to fix. So our default ret is -EIO.
+ */
+ ret = -EIO;
while ((node = ulist_next(roots, &iter))) {
root_key.objectid = node->val;
root_key.type = BTRFS_ROOT_ITEM_KEY;