fincore: (tests) don't rely on O_DIRECT bypassing the page cache
The count test writes files with "dd oflag=direct" and expects fincore
to report no pages in core for them. O_DIRECT is only a hint; whether
the written data also lands in the page cache depends on the kernel and
on the filesystem. On some GitHub CI runners all direct writes are
cached and the test fails:
-0 4096 i_JUST_PAGESIZE_directio_
+1 4096 i_JUST_PAGESIZE_directio_
Keep the direct writes, but drop the just written range from the page
cache with fadvise(POSIX_FADV_DONTNEED) afterwards. Only the written
range is dropped (not the whole file) to keep the mixed incore/directio
cases meaningful. The expected outputs are unchanged.
Signed-off-by: Karel Zak <kzak@redhat.com>
1 file changed