[LTP] [PATCH 2/3] swapon04: Add test for discard flags
Li Wang
li.wang@linux.dev
Fri Aug 28 11:12:14 CEST 2026
On Fri, Aug 28, 2026 at 09:02:43AM +0000, Andrea Cervesato wrote:
> > Great, this works!
> >
> > I think the fsync after tst_fill_file() ensures all allocated blocks are
> > flushed to disk, so stat() reflects the real block count.
> >
> > Feel free to add my RBT with this change applied:
> >
> > Reviewed-by: Li Wang <li.wang@linux.dev>
>
> there we are :-) will send a new version with the R-B tags
Hmm, I thought about it again. Perhaps we don't need this change.
Comparing the results on 6.12 and 5.14 kernels, only 6.6 needs the sync().
If the swap file contains delalloc blocks, the kernel should flush
them to disk first, then perform the discard.
If the kernel instead discards "nonexistent blocks" directly — making
the discard ineffective — that could be considered a minor bug, though
the impact is limited.
--
Regards,
Li Wang
More information about the ltp
mailing list