Re: [PATCH for v6.3 regression] mm/mremap: fix vm_pgoff in vma_merge() case 3

From: Vlastimil Babka
Date: Fri Apr 28 2023 - 03:13:23 EST


On 4/28/23 04:53, Linus Torvalds wrote:
> Hi Vlastimil,

Hi Linus,

> On Thu, Apr 27, 2023 at 8:12 AM Linus Torvalds
> <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> Ack. It's in my tree as commit 7e7757876f25 right now (not pushed out
>> yet, will do the usual build tests and look around for other things
>> pending).
>
> Gaah. I just merged Andrew's MM tree, and while it had a lot of small
> conflicts (and the ext4 ones were annoying semantic ones), the only
> one that was in *confusing* code was the one introduced by this
> one-liner fix.
>
> I'm pretty sure I did the right thing, particularly given your other
> patch for the mm tree, but please humor me and take a look at it?

Sure, took a look and looks correct to me, thanks!

> That 'vma_merge()' function is the function from hell.

Yeah, unfortunately. But despite the bugs, I believe Liam's changes in 6.3
improved it a lot, as with __vma_adjust() it was much worse (it did e.g.
things like "swap(vma, expand)" in some cases). And hopefully the cleanups
from me and Lorenzo in the mm 6.4 pull request improved readability too,
even though it made the merge tricky.

> I haven't pushed out yet because it's still going through my build
> tests, but it should be out soon.
>
> Linus