mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
selftests/mm: skip gup_longterm tests on weird filesystems
Some filesystems don't support ftruncate()ing unlinked files. They return ENOENT. In that case, skip the test. Link: https://lkml.kernel.org/r/20250311-mm-selftests-v4-8-dec210a658f5@google.com Signed-off-by: Brendan Jackman <jackmanb@google.com> Cc: Dev Jain <dev.jain@arm.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Mateusz Guzik <mjguzik@gmail.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
571a4b62ed
commit
32b42970e8
|
|
@ -96,7 +96,15 @@ static void do_test(int fd, size_t size, enum test_type type, bool shared)
|
|||
int ret;
|
||||
|
||||
if (ftruncate(fd, size)) {
|
||||
ksft_test_result_fail("ftruncate() failed (%s)\n", strerror(errno));
|
||||
if (errno == ENOENT) {
|
||||
/*
|
||||
* This can happen if the file has been unlinked and the
|
||||
* filesystem doesn't support truncating unlinked files.
|
||||
*/
|
||||
ksft_test_result_skip("ftruncate() failed with ENOENT\n");
|
||||
} else {
|
||||
ksft_test_result_fail("ftruncate() failed (%s)\n", strerror(errno));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user