inode01: Configure 4KB cluster size on exfat to prevent ENOSPC - #1340
inode01: Configure 4KB cluster size on exfat to prevent ENOSPC#1340kinshu-mangal wants to merge 1 commit into
Conversation
|
@pevik @metan-ucw Hi! This fixes an ENOSPC failure when running inode01 on exfat filesystems formatted by exfatprogs. exfatprogs defaults to a 128KB cluster size on volumes <= 32GB, which leaves only 4,080 clusters on a 512MB test device (failing inode01's 10,920 file creation). Explicitly setting |
|
Hi @kinshu-mangal , I had tried to address this issue here by changing dev_min_size to fit the 32K clusters exfat normally picks for a volume this size. Probably I should have changed it to 255M instead to make cluster size default to 4KB (https://github.com/exfatprogs/exfatprogs/blob/8b427483164888f0a5af5e4ba92da4981f1094e2/lib/libexfat.c#L203) Anyway, your fix looks like the better approach. |
In the multi-process scenario, inode01 creates tens of thousands of objects (files and directories) across 5 parallel workers. mkfs.exfat (exfatprogs) defaults to a 32KB cluster size on a 512MB test volume (256MB < size <= 32GB). This provides only ~16,000 clusters, causing the test to run out of clusters and fail with ENOSPC. Fix this by configuring exfat to format with a 4KB cluster size (-c 4K) via the struct tst_fs mkfs_opts field, providing ~130,000 clusters. Signed-off-by: Kinshu Agrawal <kinshu@google.com>
|
Hi @Avinesh, thank you for the review! You are completely right—on Android (using standard exfatprogs), Even with the 32KB default, a 512MB volume only provides ~16,000 clusters. In Setting I have updated the commit message to correct the 32KB default description! |
e0291d6 to
09cbefa
Compare
…ario The parallel scenario keeps every worker's tree on the device at the same time. On exfat each object costs a full cluster and mkfs.exfat defaults to 32K cluster size for a volume above 256M, causing ENOSPC on a 300M device. Increase the dev_min_size to 512M. tst_test.c:1985: TINFO: === Testing on exfat === tst_test.c:1291: TINFO: Formatting /dev/loop0 with exfat opts='' extra opts='' tst_test.c:1303: TINFO: Mounting /dev/loop0 to /var/tmp/LTP_inoLqT9T5/mntpoint fstyp=exfat flags=0 inode01.c:241: TINFO: Testing single-process small tree (depth=3 fanout=4 repetitions=100 workers=1) inode01.c:228: TPASS: Created and verified 28 objects in mntpoint/inode.5827 inode01.c:241: TINFO: Testing parallel larger trees (depth=6 fanout=6 repetitions=8 workers=5) inode01.c:61: TBROK: write(3,0x7ffcea2c2370,73) failed: ENOSPC (28) tst_test.c:478: TINFO: Child process reported TBROK killing the test inode01.c:64: TBROK: mkdir(mntpoint/inode.5832/00001457/00001701/00001862/00001890/00001907/00001911, 0777) failed: ENOSPC (28) Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com> Fixes: 8ea9553 ("inode: convert to new API and merge into a single test") Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com> Link: https://lore.kernel.org/20260730134102.132477-1-avinesh.kumar@suse.com
LGTM. I see a small issue with formatting with non-default option, but we can hardly do anything about it. |
|
Thank you @pevik for the review and approval! |
|
@kinshu-mangal FYI (as noted in PR) LTP is really mail based project, if you can, please send next patches on LTP ML. |
In the multi-process scenario, inode01 creates 10,920 objects (files and directories) across 5 parallel workers.
On Android, mkfs.exfat (exfatprogs) defaults to a 128KB cluster size on volumes <= 32GB. On a 512MB test volume, this provides only 4,080 clusters, causing the test to run out of clusters and fail with ENOSPC.
Fix this by configuring exfat to format with a 4KB cluster size (-c 4K) via the struct tst_fs mkfs_opts field.