Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftest/mm: skip if fallocate() is unsupported in gup_longterm

Currently gup_longterm assumes that filesystems support fallocate() and
uses that to allocate space in files, however this is an optional feature
and is in particular not implemented by NFSv3 which is commonly used in CI
systems leading to spurious failures. Check for lack of support and
report a skip instead for that case.

Link: https://lkml.kernel.org/r/20250613-selftest-mm-gup-longterm-fallocate-nfs-v1-1-758a104c175f@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Mark Brown and committed by
Andrew Morton
3e49aa8e 4535cb33

+9 -1
+9 -1
tools/testing/selftests/mm/gup_longterm.c
··· 114 114 } 115 115 116 116 if (fallocate(fd, 0, 0, size)) { 117 - if (size == pagesize) { 117 + /* 118 + * Some filesystems (eg, NFSv3) don't support 119 + * fallocate(), report this as a skip rather than a 120 + * test failure. 121 + */ 122 + if (errno == EOPNOTSUPP) { 123 + ksft_print_msg("fallocate() not supported by filesystem\n"); 124 + result = KSFT_SKIP; 125 + } else if (size == pagesize) { 118 126 ksft_print_msg("fallocate() failed (%s)\n", strerror(errno)); 119 127 result = KSFT_FAIL; 120 128 } else {