diff options
| -rw-r--r-- | fs/btrfs/disk-io.c | 11 | ||||
| -rw-r--r-- | fs/btrfs/extent-tree.c | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 11d0ad30e203..5ae1c0fcfce0 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -1922,7 +1922,11 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1922 | 1922 | ||
| 1923 | csum_root->track_dirty = 1; | 1923 | csum_root->track_dirty = 1; |
| 1924 | 1924 | ||
| 1925 | btrfs_read_block_groups(extent_root); | 1925 | ret = btrfs_read_block_groups(extent_root); |
| 1926 | if (ret) { | ||
| 1927 | printk(KERN_ERR "Failed to read block groups: %d\n", ret); | ||
| 1928 | goto fail_block_groups; | ||
| 1929 | } | ||
| 1926 | 1930 | ||
| 1927 | fs_info->generation = generation; | 1931 | fs_info->generation = generation; |
| 1928 | fs_info->last_trans_committed = generation; | 1932 | fs_info->last_trans_committed = generation; |
| @@ -1932,7 +1936,7 @@ struct btrfs_root *open_ctree(struct super_block *sb, | |||
| 1932 | fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root, | 1936 | fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root, |
| 1933 | "btrfs-cleaner"); | 1937 | "btrfs-cleaner"); |
| 1934 | if (IS_ERR(fs_info->cleaner_kthread)) | 1938 | if (IS_ERR(fs_info->cleaner_kthread)) |
| 1935 | goto fail_csum_root; | 1939 | goto fail_block_groups; |
| 1936 | 1940 | ||
| 1937 | fs_info->transaction_kthread = kthread_run(transaction_kthread, | 1941 | fs_info->transaction_kthread = kthread_run(transaction_kthread, |
| 1938 | tree_root, | 1942 | tree_root, |
| @@ -2020,7 +2024,8 @@ fail_cleaner: | |||
| 2020 | filemap_write_and_wait(fs_info->btree_inode->i_mapping); | 2024 | filemap_write_and_wait(fs_info->btree_inode->i_mapping); |
| 2021 | invalidate_inode_pages2(fs_info->btree_inode->i_mapping); | 2025 | invalidate_inode_pages2(fs_info->btree_inode->i_mapping); |
| 2022 | 2026 | ||
| 2023 | fail_csum_root: | 2027 | fail_block_groups: |
| 2028 | btrfs_free_block_groups(fs_info); | ||
| 2024 | free_extent_buffer(csum_root->node); | 2029 | free_extent_buffer(csum_root->node); |
| 2025 | free_extent_buffer(csum_root->commit_root); | 2030 | free_extent_buffer(csum_root->commit_root); |
| 2026 | fail_dev_root: | 2031 | fail_dev_root: |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 503a18eaef52..4c910359c807 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -4170,6 +4170,10 @@ static noinline int find_free_extent(struct btrfs_trans_handle *trans, | |||
| 4170 | ins->offset = 0; | 4170 | ins->offset = 0; |
| 4171 | 4171 | ||
| 4172 | space_info = __find_space_info(root->fs_info, data); | 4172 | space_info = __find_space_info(root->fs_info, data); |
| 4173 | if (!space_info) { | ||
| 4174 | printk(KERN_ERR "No space info for %d\n", data); | ||
| 4175 | return -ENOSPC; | ||
| 4176 | } | ||
| 4173 | 4177 | ||
| 4174 | if (orig_root->ref_cows || empty_size) | 4178 | if (orig_root->ref_cows || empty_size) |
| 4175 | allowed_chunk_alloc = 1; | 4179 | allowed_chunk_alloc = 1; |
| @@ -7372,7 +7376,6 @@ static int find_first_block_group(struct btrfs_root *root, | |||
| 7372 | } | 7376 | } |
| 7373 | path->slots[0]++; | 7377 | path->slots[0]++; |
| 7374 | } | 7378 | } |
| 7375 | ret = -ENOENT; | ||
| 7376 | out: | 7379 | out: |
| 7377 | return ret; | 7380 | return ret; |
| 7378 | } | 7381 | } |
