[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220719184938.3359932-1-Liam.Howlett@oracle.com>
Date: Tue, 19 Jul 2022 18:49:48 +0000
From: Liam Howlett <liam.howlett@...cle.com>
To: "maple-tree@...ts.infradead.org" <maple-tree@...ts.infradead.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Hugh Dickins <hughd@...gle.com>
CC: Yu Zhao <yuzhao@...gle.com>
Subject: [PATCH] mmap: Remove unroll from __vma_adjust()
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@...gle.com>
Signed-off-by: Liam R. Howlett <Liam.Howlett@...cle.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
Powered by blists - more mailing lists