[LTP] [PATCH 2/3] swapon04: Add test for discard flags

Andrea Cervesato andrea.cervesato@suse.com
Fri Aug 28 10:30:02 CEST 2026


Hi Li,

> I encountered an intermittent failure on my x86_64 platform running kernel 6.6.
> This needs further investigation.
> 
> tst_test.c:1986: TINFO: === Testing on xfs ===
> tst_test.c:1291: TINFO: Formatting /dev/loop0 with xfs opts='' extra opts=''
> tst_test.c:1303: TINFO: Mounting /dev/loop0 to /tmp/LTP_swa4Dz6aP/mntpoint fstyp=xfs flags=0
> tst_device.c:103: TINFO: Found free device 1 '/dev/loop1'
> swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> swapon04.c:168: TPASS: blocks_after <= max_header_blocks (8 <= 16)
> swapon04.c:168: TFAIL: blocks_after (32648) > max_header_blocks (16)
> swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> swapon04.c:168: TPASS: blocks_after <= max_header_blocks (8 <= 16)
> swapon04.c:170: TPASS: blocks_after == blocks_before (32768)
> swapon04.c:170: TPASS: blocks_after == blocks_before (32768)

this is interesting. Also I notice how it's hard to read the logs, so
I need a TINFO before the checks. But technically, this could be a kernel
bug: can you please add a sync() before stat() while we are getting the
blocks_after? We might need to flush the cache before reading the blocks.

	fd = SAFE_OPEN(BACKING_FILE, O_RDONLY);
	SAFE_FSYNC(fd);
	SAFE_CLOSE(fd);

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com


More information about the ltp mailing list