btrfs: mkfs: use sectorsize as nodesize for mixed profiles
PATCH 1/1 btrfs: mkfs: use sectorsize as nodesize for mixed profiles
[BUG]
When running btrfs/011 with subpage case, even with RAID56 support, it still fails with the following error:
QA output created by 011
*** test btrfs replace
mkfs failed
(see /home/adam/xfstests-dev/results//btrfs/011.full for details)
The full log shows:
---------workout "-m single -d single -M" 1 no 64-----------
ERROR: illegal nodesize 65536 (not equal to 4096 for mixed block group) mkfs failed
This is a critical error, making test case to be aborted, without checking the rest profiles.
[CAUSE]
Mkfs.btrfs always uses the maximum value between sectorsize and page size for its mixed profile nodesize.
For subpage case, it means we always go PAGE_SIZE, no matter whatever the sectorsize is passed in.
[FIX]
Just get rid of the direct PAGE_SIZE usage when determining nodesize for mixed profiles.
And use sectorsize directly (either passed in by the user, or deteremined from page size).
--- mkfs/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
mkfs/main.c +1 -3
@@ -1261,8 +1261,6 @@ int BOX_MAIN(mkfs)(int argc, char **argv) data_profile = tmp; } }else { -u32 best_nodesize =max_t (u32,sysconf (_SC_PAGESIZE), sectorsize); -if (metadata_profile_opt || data_profile_opt) {if (metadata_profile != data_profile) { error(
@@ -1272,7 +1270,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv) }if (!nodesize_forced) - nodesize = best_nodesize; + nodesize = sectorsize; }/*
Signature · 1 line
2.35.1
Quoted 22 lines · Qu Wenruo
[BUG]
When running btrfs/011 with subpage case, even with RAID56 support, it still fails with the following error:QA output created by 011
*** test btrfs replace
mkfs failed
(see/home/adam/xfstests-dev/results//btrfs/011.fullfor details)The full log shows:
---------workout "-m single -d single -M" 1 no 64-----------
ERROR: illegal nodesize 65536 (not equal to 4096 for mixed block group) mkfs failedThis is a critical error, making test case to be aborted, without checking the rest profiles.
[CAUSE]
Mkfs.btrfs always uses the maximum value between sectorsize and page size for its mixed profile nodesize.
Quoted 8 lines
For subpage case, it means we always go
PAGE_SIZE, no matter whatever the sectorsize is passed in.[FIX]
Just get rid of the directPAGE_SIZEusage when determining nodesize for mixed profiles.
And use sectorsize directly (either passed in by the user, or deteremined from page size).
Ok, I think it's a sane fallback, on x86_64 there's no change. Added to devel, thanks.