Hi Andrew
Anshuman reminded me that the issue was not limited to the
run_with_memfd_hugetlb function,
so I have released a new version addressing the problem in other places
as well.
So, please help update this patch to version 2.
https://lore.kernel.org/all/20250113050908.93638-1-hao.ge@xxxxxxxxx/
I apologize for any inconvenience this has caused.
Thanks
Best Regards
Hao
On 2025/1/13 12:29, Andrew Morton wrote:
The patch titled
Subject: selftests/mm/cow: modify the incorrect checking parameters
has been added to the -mm mm-unstable branch. Its filename is
selftests-mm-cow-modify-the-incorrect-checking-parameters.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-cow-modify-the-incorrect-checking-parameters.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Hao Ge <gehao@xxxxxxxxxx>
Subject: selftests/mm/cow: modify the incorrect checking parameters
Date: Mon, 13 Jan 2025 11:28:58 +0800
In run_with_memfd_hugetlb(), some error handle have passed incorrect
parameters. It should be "smem", but it was mistakenly written as "mem".
Let's fix it.
Link: https://lkml.kernel.org/r/20250113032858.63670-1-hao.ge@xxxxxxxxx
Fixes: baa489fabd01 ("selftests/vm: rename selftests/vm to selftests/mm")
Signed-off-by: Hao Ge <gehao@xxxxxxxxxx>
Cc: SeongJae Park <sj@xxxxxxxxxx>
Cc: Shuah Khan (Samsung OSG) <shuah@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
tools/testing/selftests/mm/cow.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/tools/testing/selftests/mm/cow.c~selftests-mm-cow-modify-the-incorrect-checking-parameters
+++ a/tools/testing/selftests/mm/cow.c
@@ -1692,7 +1692,7 @@ static void run_with_memfd_hugetlb(non_a
goto close;
}
smem = mmap(NULL, hugetlbsize, PROT_READ, MAP_SHARED, fd, 0);
- if (mem == MAP_FAILED) {
+ if (smem == MAP_FAILED) {
ksft_test_result_fail("mmap() failed\n");
goto munmap;
}
@@ -1704,7 +1704,7 @@ static void run_with_memfd_hugetlb(non_a
fn(mem, smem, hugetlbsize);
munmap:
munmap(mem, hugetlbsize);
- if (mem != MAP_FAILED)
+ if (smem != MAP_FAILED)
munmap(smem, hugetlbsize);
close:
close(fd);
_
Patches currently in -mm which might be from gehao@xxxxxxxxxx are
selftests-mm-cow-modify-the-incorrect-checking-parameters.patch