f84f62e6 | 21-Aug-2023 |
Andre Przywara <andre.przywara@arm.com> |
selftests: cachestat: catch failing fsync test on tmpfs
The cachestat kselftest runs a test on a normal file, which is created temporarily in the current directory. Among the tests it runs there is
selftests: cachestat: catch failing fsync test on tmpfs
The cachestat kselftest runs a test on a normal file, which is created temporarily in the current directory. Among the tests it runs there is a call to fsync(), which is expected to clean all dirty pages used by the file.
However the tmpfs filesystem implements fsync() as noop_fsync(), so the call will not even attempt to clean anything when this test file happens to live on a tmpfs instance. This happens in an initramfs, or when the current directory is in /dev/shm or sometimes /tmp.
To avoid this test failing wrongly, use statfs() to check which filesystem the test file lives on. If that is "tmpfs", we skip the fsync() test.
Since the fsync test is only one part of the "normal file" test, we now execute this twice, skipping the fsync part on the first call. This way only the second test, including the fsync part, would be skipped.
Link: https://lkml.kernel.org/r/20230821160534.3414911-3-andre.przywara@arm.com Signed-off-by: Andre Przywara <andre.przywara@arm.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Nhat Pham <nphamcs@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
show more ...
|
9b1db732 | 15-Aug-2023 |
Andre Przywara <andre.przywara@arm.com> |
selftests: cachestat: use proper syscall number macro
At the moment the cachestat syscall number is hard coded into the test source code. Remove that and replace it with the proper __NR_cachestat ma
selftests: cachestat: use proper syscall number macro
At the moment the cachestat syscall number is hard coded into the test source code. Remove that and replace it with the proper __NR_cachestat macro. That ensures compatibility should other architectures pick a different number.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Nhat Pham <nphamcs@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
show more ...
|