Commit 32b42970 authored by Brendan Jackman's avatar Brendan Jackman Committed by Andrew Morton
Browse files

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: default avatarBrendan 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 571a4b62
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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)) {
		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;
	}