selftests/filesystems: check listmount() with a U64_MAX cursor

Pass the largest possible mount id as the cursor and check that
listmount() returns no entries instead of starting over at the first
mount.

Link: https://patch.msgid.link/20261021-work-mount-statmount_listns_fixes-v1-4-8917a4c1bd14@kernel.org
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
Christian Brauner 2026-10-21 13:46:57 +02:00
parent 95a5412022
commit 8c407f829a
No known key found for this signature in database
GPG Key ID: 91C61BC06578DCA2

View File

@ -63,4 +63,15 @@ TEST(listmount_backward)
}
}
/* A cursor at the largest possible mount id must not wrap around. */
TEST(listmount_cursor_max)
{
uint64_t list[LISTMNT_BUFFER];
ssize_t nr_mounts;
nr_mounts = listmount(LSMT_ROOT, 0, UINT64_MAX, list,
LISTMNT_BUFFER, 0);
ASSERT_EQ(nr_mounts, 0);
}
TEST_HARNESS_MAIN