diff mbox series

mmap: Remove unroll from vma_expand()

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

Commit Message

Liam R. Howlett July 19, 2022, 6:50 p.m. UTC
Undoing the anon vma work is no necessary since it will be handled by
the caller in the freeing of the VMA, or in the OOM that is happening.

Fixes: d8bb385648a5 (mm/mmap: use advanced maple tree API for mmap_region())
Suggested-by:Hugh Dickins <hughd@google.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
---
 mm/mmap.c | 4 ----
 1 file changed, 4 deletions(-)
diff mbox series

Patch

diff --git a/mm/mmap.c b/mm/mmap.c
index 139862557cc1..7440f250581d 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -670,7 +670,6 @@  inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
 	struct anon_vma *anon_vma = vma->anon_vma;
 	struct file *file = vma->vm_file;
 	bool remove_next = false;
-	bool anon_cloned = false;
 
 	if (next && (vma != next) && (end == next->vm_end)) {
 		remove_next = true;
@@ -682,7 +681,6 @@  inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
 			error = anon_vma_clone(vma, next);
 			if (error)
 				return error;
-			anon_cloned = true;
 		}
 	}
 
@@ -765,8 +763,6 @@  inline int vma_expand(struct ma_state *mas, struct vm_area_struct *vma,
 	return 0;
 
 nomem:
-	if (anon_cloned)
-		unlink_anon_vmas(vma);
 	return -ENOMEM;
 }