[LTP] tse_swap: Fill swapfile with zeroes on exFAT
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Nov 10 14:05:40 CET 2026
Hi Wake,
On Tue Nov 10, 2026, Wake Liu wrote:
> tse_swap: Fill swapfile with zeroes on exFAT
> - /* Fill the file if needed (specific to old xfs filesystems) */
> - if (tst_fs_type(swapfile) == TST_XFS_MAGIC) {
> + /*
> + * Fill the file if needed: swapon() rejects preallocated but
> + * unwritten blocks on old XFS and on exFAT.
> + */
> + fs_type = tst_fs_type(swapfile);
> + if (fs_type == TST_XFS_MAGIC || fs_type == TST_EXFAT_MAGIC) {
> if (tst_fill_file(swapfile, 0, blk_size, blocks) != 0)
> tst_brk_(file, lineno, TBROK, "Failed to fill swapfile");
> }
The swapon() failure on fallocate()-preallocated exFAT swapfiles in v7.2 is a
kernel regression that was fixed in v7.4 by kernel commit 4483ab85d1e0
("exfat: map allocated extents for swap activation"), which suppresses
IOMAP_REPORT during swap activation so preallocated blocks beyond valid_size
are mapped as IOMAP_UNWRITTEN instead of IOMAP_HOLE. Filling the swapfile with
zeroes on exFAT works around this kernel bug in LTP and masks the failure on
kernels missing that fix, so this change should be dropped.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list