summaryrefslogtreecommitdiff
path: root/btrfsck.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2012-02-09 11:53:33 -0500
committerChris Mason <chris.mason@oracle.com>2012-02-09 11:53:33 -0500
commitae1822f73f92adca8ccfac24bc0e6e440f776fa4 (patch)
tree3fb47212ae733bd40f9aa62a73d2c2c9adcf4b11 /btrfsck.c
parent47b104b7f17b37813244691829daf4302831acf1 (diff)
btrfsck: make sure we fix the block group accounting during repair
The block group accounting is fixed after we check the extent back references. This makes sure the accounting is fixed unless we were not able to repair the backrefs. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'btrfsck.c')
-rw-r--r--btrfsck.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/btrfsck.c b/btrfsck.c
index 606ebfca..e6fe926e 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -3070,7 +3070,12 @@ repair_abort:
if (ret) {
fprintf(stderr, "failed to repair damaged filesystem, aborting\n");
exit(1);
+ } else {
+ btrfs_fix_block_accounting(trans, root);
}
+ if (err)
+ fprintf(stderr, "repaired damaged extent references\n");
+ return ret;
}
return err;
}
@@ -3262,11 +3267,10 @@ int main(int ac, char **av)
}
ret = check_extents(trans, root, repair);
- if (ret)
+ if (ret) {
+ fprintf(stderr, "check extents failed with %d!!!!!!!!!\n", ret);
goto out;
-
- if (repair)
- btrfs_fix_block_accounting(trans, root);
+ }
fprintf(stderr, "checking fs roots\n");
ret = check_fs_roots(root, &root_cache);