Re: [PATCH] mm: page_ext: validate section in for_each_page_ext iterator
From: David Hildenbrand (Arm)
Date: Fri Jun 19 2026 - 09:45:39 EST
On 6/19/26 15:38, Matthew Wilcox wrote:
> On Fri, Jun 19, 2026 at 10:00:59AM +0200, David Hildenbrand (Arm) wrote:
>> Likely we should just handle that in the iterator, looking up page-ext for something
>> that doesn't exist is weird.
>
> Yes, but I prefer to pass 'max' to the _next step explicitly, rather
> than put it in the iterator struct. Untested patch attached.
Yeah, no strong opinion, same fix idea.
>
> The other way to do it is s/index/remaining/ and count it down rather
> than upwards. But that assumes none of the iterator users look at
> iter->index, and I don't have the patience to check that.
>
> I find it weird that somebody botheresd to add kernel-doc for
> page_ext_iter_begin/next. They're internal implementation and really
> shouldn't have public documentation.
Yeah, Luiz was just very thorough :)
--
Cheers,
David