diff mbox series

mmap: Remove unroll from __vma_adjust()

Message ID 20220719184938.3359932-1-Liam.Howlett@oracle.com (mailing list archive)
State New
Headers show
Series mmap: Remove unroll from __vma_adjust() | expand

Commit Message

Liam R. Howlett July 19, 2022, 6:49 p.m. UTC
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 mbox series

Patch

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;