FAILED: patch "[PATCH] btrfs: reset max_extent_size properly" failed to apply to 4.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
21a94f7acf0f748599ea552af5d9ee7d7e41c72fMon Sep 17 00:00:00 2001
From: Josef Bacik <[email protected]>
Date: Thu, 11 Oct 2018 15:54:03 -0400
Subject: [PATCH] btrfs: reset max_extent_size properly
If we use up our block group before allocating a new one we'll easily get a max_extent_size that's set really really low, which will result in a lot of fragmentation. We need to make sure we're resetting the max_extent_size when we add a new chunk or add new space.
fs/btrfs/extent-tree.c +2 -0
@@ -4565,6 +4565,7 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags, goto out; }else { ret =1 ; + space_info->max_extent_size =0 ; } space_info->force_alloc =CHUNK_ALLOC_NO_FORCE ;
@@ -6459,6 +6460,7 @@ static void btrfs_free_reserved_bytes(struct btrfs_block_group_cache *cache, space_info->bytes_readonly += num_bytes; cache->reserved -= num_bytes; space_info->bytes_reserved -= num_bytes; + space_info->max_extent_size =0 ;if (delalloc) cache->delalloc_bytes -= num_bytes;