Hi Mike!
On 8/9/26 1:33 PM, Mike Rapoport (Microsoft) wrote:
> Commit 49a4e7186b08 ("selftests/mm: thuge-gen: add setup of HugeTLB pages")
> changed thuge-gen test to use common functions for reading hugetlb
> attributes from sysfs, but it missed that the original read_free() function
> special cased PAGE_SIZE tests.
>
> For PAGE_SIZE tests, failure to read sysfs was ignored and read_free()
> returned 0.>
> This allowed test_shmget() to essentially skip the check of how many huge
> pages was consumed when it ran with PAGE_SIZE.
>
> Commit 3199b0c09efa ("selftests/mm: fix read_file() return value check")
> fixed the common read_file() to actually return error on failure and this
This commit does not make read_file return an error, it just fixes a
"read_file() < 0" check, which can never happen since currently
read_file() never returns a negative number.
The patch from my series, "selftests/mm: make file helpers return
errors" [1], is the one that changes read_file() to return a negative
errno on failure. It also exposed the same test_shmget() issue and
caused the CI failure [2]. I also debugged the failure and traced it to
test_shmget() [3].
I was planning to fix this in my next revision, but I will drop that
change now. :)
Rest the change looks good, so:
Reviewed-by: Sarthak Sharma <[email protected]>
[1]
https://lore.kernel.org/all/[email protected]/
[2]
https://github.com/linux-mm/linux-mm/actions/runs/30553882784/job/90909219578
[3]
https://lore.kernel.org/all/[email protected]/