diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 3181759da1cf..c479d71e2869 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -1872,8 +1872,15 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans, | |||
1872 | return 0; | 1872 | return 0; |
1873 | } | 1873 | } |
1874 | /* if metadata always pin */ | 1874 | /* if metadata always pin */ |
1875 | if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID) | 1875 | if (owner_objectid < BTRFS_FIRST_FREE_OBJECTID) { |
1876 | if (root->root_key.objectid == BTRFS_TREE_LOG_OBJECTID) { | ||
1877 | /* btrfs_free_reserved_extent */ | ||
1878 | set_extent_dirty(&root->fs_info->free_space_cache, | ||
1879 | bytenr, bytenr + num_bytes - 1, GFP_NOFS); | ||
1880 | return 0; | ||
1881 | } | ||
1876 | pin = 1; | 1882 | pin = 1; |
1883 | } | ||
1877 | 1884 | ||
1878 | /* if data pin when any transaction has committed this */ | 1885 | /* if data pin when any transaction has committed this */ |
1879 | if (ref_generation != trans->transid) | 1886 | if (ref_generation != trans->transid) |
@@ -2361,11 +2368,13 @@ int btrfs_alloc_extent(struct btrfs_trans_handle *trans, | |||
2361 | min_alloc_size, empty_size, hint_byte, | 2368 | min_alloc_size, empty_size, hint_byte, |
2362 | search_end, ins, data); | 2369 | search_end, ins, data); |
2363 | BUG_ON(ret); | 2370 | BUG_ON(ret); |
2364 | ret = __btrfs_alloc_reserved_extent(trans, root, root_objectid, | 2371 | if (root_objectid != BTRFS_TREE_LOG_OBJECTID) { |
2365 | ref_generation, owner, | 2372 | ret = __btrfs_alloc_reserved_extent(trans, root, root_objectid, |
2366 | owner_offset, ins); | 2373 | ref_generation, owner, |
2367 | BUG_ON(ret); | 2374 | owner_offset, ins); |
2375 | BUG_ON(ret); | ||
2368 | 2376 | ||
2377 | } | ||
2369 | maybe_unlock_mutex(root); | 2378 | maybe_unlock_mutex(root); |
2370 | return ret; | 2379 | return ret; |
2371 | } | 2380 | } |