[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <08023d47-dcf4-4efb-bf13-5aef3c6dca14@redhat.com>
Date: Thu, 6 Mar 2025 10:28:09 +0100
From: David Hildenbrand <david@...hat.com>
To: Brendan Jackman <jackmanb@...gle.com>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>, Shuah Khan <shuah@...nel.org>
Cc: Dev Jain <dev.jain@....com>, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 08/10] selftests/mm: Skip gup_longerm tests on weird
filesystems
On 28.02.25 17:54, Brendan Jackman wrote:
> Some filesystems don't support funtract()ing unlinked files. They return
> ENOENT. In that case, skip the test.
>
That's not documented in the man page, so is this a bug of these
filesystems?
What are examples for these weird filesystems?
As we have the fstype available, we could instead simply reject more
filesystems earlier. See fs_is_unknown().
> Signed-off-by: Brendan Jackman <jackmanb@...gle.com>
> ---
> tools/testing/selftests/mm/gup_longterm.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/mm/gup_longterm.c b/tools/testing/selftests/mm/gup_longterm.c
> index 879e9e4e8cce8127656fabe098abf7db5f6c5e23..494ec4102111b9c96fb4947b29c184735ceb8e1c 100644
> --- a/tools/testing/selftests/mm/gup_longterm.c
> +++ b/tools/testing/selftests/mm/gup_longterm.c
> @@ -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)) {
> - ksft_test_result_fail("ftruncate() failed (%s)\n", strerror(errno));
> + 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;
> }
>
>
--
Cheers,
David / dhildenb
Powered by blists - more mailing lists