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.

selftests/mm: skip failed memfd setups in gup_longterm

Unlike the other cases gup_longterm's memfd tests previously skipped the
test when failing to set up the file descriptor to test. Restore this
behavior to avoid hitting failures when hugetlb isn't configured.

Link: https://lkml.kernel.org/r/20250605-selftest-mm-gup-longterm-tweaks-v1-1-2fae34b05958@kernel.org
Fixes: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")
Signed-off-by: Mark Brown <broonie@kernel.org>
Reported-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Closes: https://lkml.kernel.org/r/a76fc252-0fe3-4d4b-a9a1-4a2895c2680d@lucifer.local
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Tested-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: 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
b1a529bd 19272b37

+6 -1
+6 -1
tools/testing/selftests/mm/gup_longterm.c
··· 298 298 log_test_start("%s ... with memfd", desc); 299 299 300 300 fd = memfd_create("test", 0); 301 - if (fd < 0) 301 + if (fd < 0) { 302 302 ksft_print_msg("memfd_create() failed (%s)\n", strerror(errno)); 303 + log_test_result(KSFT_SKIP); 304 + return; 305 + } 303 306 304 307 fn(fd, pagesize); 305 308 close(fd); ··· 369 366 fd = memfd_create("test", flags); 370 367 if (fd < 0) { 371 368 ksft_print_msg("memfd_create() failed (%s)\n", strerror(errno)); 369 + log_test_result(KSFT_SKIP); 370 + return; 372 371 } 373 372 374 373 fn(fd, hugetlbsize);