Re: [PATCH] btrfs-progs: Drop the type check in init_alloc_chunk_ctl_policy_regular
From: Qu Wenruo <hidden>
Date: 2021-08-18 11:26:53
On 2021/8/18 下午6:35, David Sterba wrote:
On Wed, Aug 18, 2021 at 01:17:46PM +0800, Qu Wenruo wrote:quoted
On 2021/8/17 下午9:24, David Sterba wrote:quoted
On Mon, Aug 09, 2021 at 03:26:13PM -0300, Marcos Paulo de Souza wrote:quoted
Signed-off-by: Marcos Paulo de Souza <redacted> --- This change mimics what the kernel currently does, which is set the stripe_size regardless of the profile. Any thoughts on it? Thanks!Makes sense to unify that, it works well for the large sizes. Please write tests that verify that the chunk sizes are correct after mkfs on various device sizes. Patch added to devel, thanks.It in fact makes fsck/025 to fail, bisection points to this patch surprisingly. Now "mkfs.btrfs -f" on a 128M file will just fail. This looks like a big problem to me though...This is known that the small filesystem size and intial chunk layout is not scaled properly, the patch OTOH fixes the more common case where the normal block group sizes fit and leave enough room for the rest. Can the test 025 be scaled up so we don't have to create the 128M filesystem? I'd rather go that way.
Sure, we can scale up the size, but this still indicates the problem of the progs chunk allocator. So far that's the only failure, but that also means, the minimal device size calculation is no longer correct. As kernel has no problem allocate SINGLE chunk smaller than 64M. I'd prefer to unify the minimal stripe size with kernel. (And of course, also do proper chunk size calculation for metadata chunks) Thanks, Qu