summaryrefslogtreecommitdiff
path: root/cmds-check.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-05-29 18:01:42 +0800
committerDavid Sterba <dsterba@suse.cz>2014-10-10 10:38:23 +0200
commit1d0a3eac0c79e076d35afbcc641a7eda2aa793bc (patch)
treefe9de5000e341d69ecec73456d100e9b92124ee6 /cmds-check.c
parentf495a2ac66116f0a1b15e73380c8cbca6e0a4ca0 (diff)
btrfs-progs: fsck: finish transaction commit if repair error out
If btrfsck fail to repair, we hit something like following: Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 Check tree block failed, want=29442048, have=0 read block failed check_tree_block found 98304 bytes used err is 1 total csum bytes: 0 total tree bytes: 0 total fs tree bytes: 0 total extent tree bytes: 0 btree space waste bytes: 0 file data blocks allocated: 0 referenced 0 Btrfs v3.14.2-rc2-63-g3944f15 btrfs: transaction.h:38: btrfs_start_transaction: Assertion `!(root->commit_root)' failed. Aborted (core dumped) This is because under repair mode, we will start a transaction, and if we error out, we don't finish this transaction. So in close_ctree(), it will try to start and commit transaction which causes the above segmentation. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-check.c')
-rw-r--r--cmds-check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds-check.c b/cmds-check.c
index a7714371..156ab727 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -6049,12 +6049,12 @@ again:
if (err && !ret)
ret = err;
+out:
if (trans) {
err = btrfs_commit_transaction(trans, root);
if (!ret)
ret = err;
}
-out:
if (repair) {
free_corrupt_blocks_tree(root->fs_info->corrupt_blocks);
root->fs_info->fsck_extent_cache = NULL;