[PATCH] tools/testing/selftests: fix gup_longterm for unknown fs

Lorenzo Stoakes posted 1 patch 1 month ago
tools/testing/selftests/mm/gup_longterm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] tools/testing/selftests: fix gup_longterm for unknown fs
Posted by Lorenzo Stoakes 1 month ago
Commit 66bce7afbaca ("selftests/mm: fix test result reporting in
gup_longterm") introduced a small bug causing unknown filesystems to always
result in a test failure.

This is because do_test() was updated to use a common reporting path, but
this case appears to have been missed.

This is problematic for e.g. virtme-ng which uses an overlayfs file system,
causing gup_longterm to appear to fail each time due to a test count
mismatch:

	# Planned tests != run tests (50 != 46)
	# Totals: pass:24 fail:0 xfail:0 xpass:0 skip:22 error:0

The fix is to simply change the return into a break.

Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Fixes: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")
---
 tools/testing/selftests/mm/gup_longterm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c
index 6279893a0adc..f61150d28eb2 100644
--- a/tools/testing/selftests/mm/gup_longterm.c
+++ b/tools/testing/selftests/mm/gup_longterm.c
@@ -179,7 +179,7 @@ static void do_test(int fd, size_t size, enum test_type type, bool shared)
 		if (rw && shared && fs_is_unknown(fs_type)) {
 			ksft_print_msg("Unknown filesystem\n");
 			result = KSFT_SKIP;
-			return;
+			break;
 		}
 		/*
 		 * R/O pinning or pinning in a private mapping is always
--
2.52.0
Re: [PATCH] tools/testing/selftests: fix gup_longterm for unknown fs
Posted by David Hildenbrand (Red Hat) 1 month ago
On 1/6/26 16:45, Lorenzo Stoakes wrote:
> Commit 66bce7afbaca ("selftests/mm: fix test result reporting in
> gup_longterm") introduced a small bug causing unknown filesystems to always
> result in a test failure.
> 
> This is because do_test() was updated to use a common reporting path, but
> this case appears to have been missed.
> 
> This is problematic for e.g. virtme-ng which uses an overlayfs file system,
> causing gup_longterm to appear to fail each time due to a test count
> mismatch:
> 
> 	# Planned tests != run tests (50 != 46)
> 	# Totals: pass:24 fail:0 xfail:0 xpass:0 skip:22 error:0
> 
> The fix is to simply change the return into a break.
> 
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Fixes: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")
> ---

Reviewed-by: David Hildenbrand (Red Hat) <david@kernel.org>

-- 
Cheers

David
Re: [PATCH] tools/testing/selftests: fix gup_longterm for unknown fs
Posted by Andrew Morton 1 month ago
On Tue,  6 Jan 2026 15:45:47 +0000 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:

> Commit 66bce7afbaca ("selftests/mm: fix test result reporting in
> gup_longterm") introduced a small bug causing unknown filesystems to always
> result in a test failure.
> 
> This is because do_test() was updated to use a common reporting path, but
> this case appears to have been missed.
> 
> This is problematic for e.g. virtme-ng which uses an overlayfs file system,
> causing gup_longterm to appear to fail each time due to a test count
> mismatch:
> 
> 	# Planned tests != run tests (50 != 46)
> 	# Totals: pass:24 fail:0 xfail:0 xpass:0 skip:22 error:0
> 
> The fix is to simply change the return into a break.
> 
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Fixes: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")

-stable users might want this?
Re: [PATCH] tools/testing/selftests: fix gup_longterm for unknown fs
Posted by Mark Brown 1 month ago
On Tue, Jan 06, 2026 at 09:28:36AM -0800, Andrew Morton wrote:
> On Tue,  6 Jan 2026 15:45:47 +0000 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:

> > Commit 66bce7afbaca ("selftests/mm: fix test result reporting in
> > gup_longterm") introduced a small bug causing unknown filesystems to always
> > result in a test failure.

> > Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > Fixes: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")

> -stable users might want this?

I think so.
Re: [PATCH] tools/testing/selftests: fix gup_longterm for unknown fs
Posted by Lorenzo Stoakes 1 month ago
On Tue, Jan 06, 2026 at 05:29:51PM +0000, Mark Brown wrote:
> On Tue, Jan 06, 2026 at 09:28:36AM -0800, Andrew Morton wrote:
> > On Tue,  6 Jan 2026 15:45:47 +0000 Lorenzo Stoakes <lorenzo.stoakes@oracle.com> wrote:
>
> > > Commit 66bce7afbaca ("selftests/mm: fix test result reporting in
> > > gup_longterm") introduced a small bug causing unknown filesystems to always
> > > result in a test failure.
>
> > > Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > > Fixes: 66bce7afbaca ("selftests/mm: fix test result reporting in gup_longterm")
>
> > -stable users might want this?
>
> I think so.

Yeh I did wonder if we'd want that, and I think you confirmed Mark that people
do potentially run tests on stable kernels? Or I can't remember :)

Anyway if so then sure. I think this should be an easy automagic-backport
anyway!

Cheers, Lorenzo