linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vma: next is already retrieved
@ 2024-11-27 11:43 Wei Yang
  2024-11-27 12:21 ` Lorenzo Stoakes
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Yang @ 2024-11-27 11:43 UTC (permalink / raw)
  To: akpm, Liam.Howlett, lorenzo.stoakes, vbabka, jannh
  Cc: linux-mm, Wei Yang, Liam R . Howlett

vma_iter_next_rewind() here gets next vma and rewind iterator.

Actually the next vma is already been retrieved to new_vma. Since the
iterator is initialized to addr, we don't need to adjust it.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Liam R. Howlett <Liam.Howlett@Oracle.com>
CC: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
CC: Vlastimil Babka <vbabka@suse.cz>
CC: Jann Horn <jannh@google.com>
---
 mm/vma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vma.c b/mm/vma.c
index 8a454a7bbc80..d419e3700fa7 100644
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -1727,7 +1727,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
 
 	vmg.vma = NULL; /* New VMA range. */
 	vmg.pgoff = pgoff;
-	vmg.next = vma_iter_next_rewind(&vmi, NULL);
+	vmg.next = new_vma;
 	new_vma = vma_merge_new_range(&vmg);
 
 	if (new_vma) {
-- 
2.34.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-01-23 11:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-27 11:43 [PATCH] mm/vma: next is already retrieved Wei Yang
2024-11-27 12:21 ` Lorenzo Stoakes
2024-11-28  1:10   ` Wei Yang
2024-11-28 15:48     ` Lorenzo Stoakes
2025-01-22  9:49       ` Wei Yang
2025-01-22 16:15         ` Lorenzo Stoakes
2025-01-23  1:47           ` Wei Yang
2025-01-23 11:18             ` Lorenzo Stoakes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox