From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-mm@kvack.org
Subject: Re: [bug report] mm/mremap: complete refactor of move_vma()
Date: Wed, 25 Jun 2025 16:41:22 +0100 [thread overview]
Message-ID: <6cf645bc-c359-40f6-a1dd-48567736517c@lucifer.local> (raw)
In-Reply-To: <9fbcc43c-736a-46f7-a376-65fa8c245527@suswa.mountain>
On Wed, Jun 25, 2025 at 06:35:59PM +0300, Dan Carpenter wrote:
> On Wed, Jun 25, 2025 at 04:28:51PM +0100, Lorenzo Stoakes wrote:
> There is an earlier error path.
>
> 1750 static int copy_vma_and_data(struct vma_remap_struct *vrm,
> 1751 struct vm_area_struct **new_vma_ptr)
> 1752 {
> 1753 unsigned long internal_offset = vrm->addr - vrm->vma->vm_start;
> 1754 unsigned long internal_pgoff = internal_offset >> PAGE_SHIFT;
> 1755 unsigned long new_pgoff = vrm->vma->vm_pgoff + internal_pgoff;
> 1756 unsigned long moved_len;
> 1757 struct vm_area_struct *vma = vrm->vma;
> 1758 struct vm_area_struct *new_vma;
> 1759 int err = 0;
> 1760 PAGETABLE_MOVE(pmc, NULL, NULL, vrm->addr, vrm->new_addr, vrm->old_len);
> 1761 bool relocate_anon = should_relocate_anon(vrm, &pmc, &err);
> 1762
> 1763 if (err)
> 1764 return err;
> ^^^^^^^^^^^
> Here.
The bug report is against the wrong patch, the error was introduced by
'mm/mremap: add MREMAP_MUST_RELOCATE_ANON' (i.e. this check).
I'm looking at a massive refactor which removess this and checked against
'mm/mremap: complete refactor of move_vma()' which is why I missed this :)
Since I'm respinning anyway I'll just ask Andrew to drop the series for now
until I come back with the reworked version.
Thanks for the report!
>
> 1765
> 1766 again:
> 1767 new_vma = copy_vma(&vma, vrm->new_addr, vrm->new_len, new_pgoff,
> 1768 &pmc.need_rmap_locks, &relocate_anon);
> 1769 if (!new_vma) {
> 1770 vrm_uncharge(vrm);
> 1771 *new_vma_ptr = NULL;
> 1772 return -ENOMEM;
> 1773 }
>
> regards,
> dan carpenter
>
>
prev parent reply other threads:[~2025-06-25 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 15:22 Dan Carpenter
2025-06-25 15:28 ` Lorenzo Stoakes
2025-06-25 15:35 ` Dan Carpenter
2025-06-25 15:41 ` Lorenzo Stoakes [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6cf645bc-c359-40f6-a1dd-48567736517c@lucifer.local \
--to=lorenzo.stoakes@oracle.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox