Re: [PATCH v4 3/6] mm: gup: move gup_must_unshare() and INTERNAL_GUP_FLAGS to gup.c

From: David Hildenbrand (Arm)

Date: Wed Nov 18 2026 - 13:01:46 EST


On 11/18/26 17:59, Rik van Riel wrote:
> On Tue, 2026-11-10 at 22:52 +0000, Yeoreum Yun wrote:
>>
>> +static inline bool gup_must_unshare(struct vm_area_struct *vma,
>> +     unsigned int flags, struct page
>> *page)
>> +{
>> + /*
>> + * FOLL_WRITE is implicitly handled correctly as the page
>> table entry
>> + * has to be writable -- and if it references (part of) an
>> anonymous
>> + * folio, that part is required to be marked exclusive.
>> + */
>> + if ((flags & (FOLL_WRITE | FOLL_PIN)) != FOLL_PIN)
>> + return false;
>
> While I was playing around with some AI loop to
> automatically improve review-prompts, one of the
> AI engines (out of 6 different ones) spotted a
> bug with this code, as used in this series.
>

Preexisting one? The please send the fix separate.

> I have a reproducer to verify it, and will send
> in the fix with v6 of my GUP series later this
> week.

If the fix is for this series, also send it here so we can squash it.

--
Cheers,

David