* [PATCH] mmap: Remove unroll from __vma_adjust()
@ 2022-07-19 18:49 Liam Howlett
0 siblings, 0 replies; only message in thread
From: Liam Howlett @ 2022-07-19 18:49 UTC (permalink / raw)
To: maple-tree, linux-mm, linux-kernel, Andrew Morton, Hugh Dickins; +Cc: Yu Zhao
If __vma_adjust() fails, then there is no reason to undo the anon vma
work since it will be done in the caller or we have been OOMed.
Fixes: 83651ef5048d (mm: start tracking VMAs with maple tree)
Suggested-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
mm/mmap.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index eed9e9d96e22..87e9e78b03c8 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -970,12 +970,8 @@ int __vma_adjust(struct vm_area_struct *vma, unsigned long start,
}
}
vma_adjust_trans_huge(orig_vma, start, end, adjust_next);
-
- if (mas_preallocate(&mas, vma, GFP_KERNEL)) {
- if (exporter && exporter->anon_vma)
- unlink_anon_vmas(importer);
+ if (mas_preallocate(&mas, vma, GFP_KERNEL))
return -ENOMEM;
- }
if (file) {
mapping = file->f_mapping;
--
2.35.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-19 18:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 18:49 [PATCH] mmap: Remove unroll from __vma_adjust() Liam Howlett
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).