Skip to content

Commit c17add7

Browse files
adam900710kdave
authored andcommitted
btrfs: Consider system chunk array size for new SYSTEM chunks
For SYSTEM chunks, despite the regular chunk item size limit, there is another limit due to system chunk array size. The extra limit was removed in a refactoring, so add it back. Fixes: e3ecdb3 ("btrfs: factor out devs_max setting in __btrfs_alloc_chunk") CC: stable@vger.kernel.org # 5.3+ Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent ba0b084 commit c17add7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/btrfs/volumes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4967,6 +4967,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
49674967
} else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
49684968
max_stripe_size = SZ_32M;
49694969
max_chunk_size = 2 * max_stripe_size;
4970+
devs_max = min_t(int, devs_max, BTRFS_MAX_DEVS_SYS_CHUNK);
49704971
} else {
49714972
btrfs_err(info, "invalid chunk type 0x%llx requested",
49724973
type);

0 commit comments

Comments
 (0)