linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs: Consider system chunk array size for new SYSTEM chunks
@ 2019-08-28  2:33 Qu Wenruo
  2019-08-28  2:33 ` [PATCH v3 2/2] btrfs: tree-checker: Fix wrong check on max devid Qu Wenruo
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Qu Wenruo @ 2019-08-28  2:33 UTC (permalink / raw)
  To: linux-btrfs

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 <wqu@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);
 	} else {
 		btrfs_err(info, "invalid chunk type 0x%llx requested",
 		       type);
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-10-24 19:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  2:33 [PATCH 1/2] btrfs: Consider system chunk array size for new SYSTEM chunks Qu Wenruo
2019-08-28  2:33 ` [PATCH v3 2/2] btrfs: tree-checker: Fix wrong check on max devid Qu Wenruo
2019-08-28  6:27   ` Nikolay Borisov
2019-08-28  6:30     ` WenRuo Qu
2019-09-10  9:07   ` Anand Jain
2019-09-10  9:12     ` WenRuo Qu
2019-09-10  9:23       ` Anand Jain
2019-08-28  6:35 ` [PATCH 1/2] btrfs: Consider system chunk array size for new SYSTEM chunks Nikolay Borisov
2019-09-10 14:01 ` Anand Jain
2019-10-24 19:40 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).