mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 02:19:51 +00:00
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: e3ecdb3fde
("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>
This commit is contained in:
parent
ba0b084ac3
commit
c17add7a1c
1 changed files with 1 additions and 0 deletions
|
@ -4967,6 +4967,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
|
||||||
} else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
|
} else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
|
||||||
max_stripe_size = SZ_32M;
|
max_stripe_size = SZ_32M;
|
||||||
max_chunk_size = 2 * max_stripe_size;
|
max_chunk_size = 2 * max_stripe_size;
|
||||||
|
devs_max = min_t(int, devs_max, BTRFS_MAX_DEVS_SYS_CHUNK);
|
||||||
} else {
|
} else {
|
||||||
btrfs_err(info, "invalid chunk type 0x%llx requested",
|
btrfs_err(info, "invalid chunk type 0x%llx requested",
|
||||||
type);
|
type);
|
||||||
|
|
Loading…
Reference in a new issue