summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fb.com>2015-01-27 14:23:21 -0800
committerJosef Bacik <jbacik@fb.com>2015-02-09 14:53:15 -0500
commitce0517b364037dd4e1dcbbbe09d57c092975fa0f (patch)
treee9e1c4d147afad2563824fca7318e97300ae9883 /cmds-check.c
parent08a45972234b3edb1348641e188f233bab6e50c1 (diff)
Btrfs-progs: unpin excluded extents as we fix things
We don't want to keep extent records pinned down if we fix stuff as we may need the space and we can be pretty sure that these records are correct. Thanks, Signed-off-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c
index 5458c282..9c379e65 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -7335,6 +7335,8 @@ static int check_extent_refs(struct btrfs_root *root,
return -EAGAIN;
while(1) {
+ int cur_err = 0;
+
fixed = 0;
recorded = 0;
cache = search_cache_extent(extent_cache, 0);
@@ -7345,6 +7347,7 @@ static int check_extent_refs(struct btrfs_root *root,
fprintf(stderr, "extent item %llu has multiple extent "
"items\n", (unsigned long long)rec->start);
err = 1;
+ cur_err = 1;
}
if (rec->refs != rec->extent_item_refs) {
@@ -7374,7 +7377,7 @@ static int check_extent_refs(struct btrfs_root *root,
}
}
err = 1;
-
+ cur_err = 1;
}
if (all_backpointers_checked(rec, 1)) {
fprintf(stderr, "backpointer mismatch on [%llu %llu]\n",
@@ -7388,6 +7391,7 @@ static int check_extent_refs(struct btrfs_root *root,
goto repair_abort;
fixed = 1;
}
+ cur_err = 1;
err = 1;
}
if (!rec->owner_ref_checked) {
@@ -7402,10 +7406,16 @@ static int check_extent_refs(struct btrfs_root *root,
fixed = 1;
}
err = 1;
+ cur_err = 1;
}
remove_cache_extent(extent_cache, cache);
free_all_extent_backrefs(rec);
+ if (!init_extent_tree && repair && (!cur_err || fixed))
+ clear_extent_dirty(root->fs_info->excluded_extents,
+ rec->start,
+ rec->start + rec->max_size - 1,
+ GFP_NOFS);
free(rec);
}
repair_abort: