diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/disk-io.c | 5 | ||||
-rw-r--r-- | fs/btrfs/tree-log.c | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index eb7c14308521..5031e6dd5938 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -3253,6 +3253,11 @@ void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root) | |||
3253 | if (btrfs_root_refs(&root->root_item) == 0) | 3253 | if (btrfs_root_refs(&root->root_item) == 0) |
3254 | synchronize_srcu(&fs_info->subvol_srcu); | 3254 | synchronize_srcu(&fs_info->subvol_srcu); |
3255 | 3255 | ||
3256 | if (fs_info->fs_state & BTRFS_SUPER_FLAG_ERROR) { | ||
3257 | btrfs_free_log(NULL, root); | ||
3258 | btrfs_free_log_root_tree(NULL, fs_info); | ||
3259 | } | ||
3260 | |||
3256 | __btrfs_remove_free_space_cache(root->free_ino_pinned); | 3261 | __btrfs_remove_free_space_cache(root->free_ino_pinned); |
3257 | __btrfs_remove_free_space_cache(root->free_ino_ctl); | 3262 | __btrfs_remove_free_space_cache(root->free_ino_ctl); |
3258 | free_fs_root(root); | 3263 | free_fs_root(root); |
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index e8b7a68e1b37..8e85e0e4333d 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -2466,8 +2466,10 @@ static void free_log_tree(struct btrfs_trans_handle *trans, | |||
2466 | .process_func = process_one_buffer | 2466 | .process_func = process_one_buffer |
2467 | }; | 2467 | }; |
2468 | 2468 | ||
2469 | ret = walk_log_tree(trans, log, &wc); | 2469 | if (trans) { |
2470 | BUG_ON(ret); | 2470 | ret = walk_log_tree(trans, log, &wc); |
2471 | BUG_ON(ret); | ||
2472 | } | ||
2471 | 2473 | ||
2472 | while (1) { | 2474 | while (1) { |
2473 | ret = find_first_extent_bit(&log->dirty_log_pages, | 2475 | ret = find_first_extent_bit(&log->dirty_log_pages, |