On 28/8/19 10:33 AM, Qu Wenruo wrote:
For SYSTEM chunks, despite the regular chunk item size limit, there is
another limit due to system chunk array size.

The extra limit is removed in a refactor, so just add it back.

Fixes: e3ecdb3fdecf ("btrfs: factor out devs_max setting in 
__btrfs_alloc_chunk")
Signed-off-by: Qu Wenruo <w...@suse.com>
---
  fs/btrfs/volumes.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index a447d3ec48d5..8b72d03738d9 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4966,6 +4966,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle 
*trans,
        } else if (type & BTRFS_BLOCK_GROUP_SYSTEM) {
                max_stripe_size = SZ_32M;
                max_chunk_size = 2 * max_stripe_size;
+               devs_max = min_t(int, devs_max, BTRFS_MAX_DEVS_SYS_CHUNK);

Reviewed-by: Anand Jain <anand.j...@oracle.com>

Thanks, Anand


        } else {
                btrfs_err(info, "invalid chunk type 0x%llx requested",
                       type);


Reply via email to