[PATCH] mm: support poison recovery from do_cow_fault() fix

Kefeng Wang
2024-09-10T02:15:52Z

unlock/put vmf->page, per Miaohe

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
mm/memory.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/memory.c b/mm/memory.c
index b84443e689a8..47c0202136c9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -5096,11 +5096,12 @@ static vm_fault_t do_cow_fault(struct vm_fault *vmf)

if (copy_mc_user_highpage(vmf->cow_page, vmf->page, vmf->address, vma)) {
ret = VM_FAULT_HWPOISON;
- goto uncharge_out;
+ goto unlock;
}
__folio_mark_uptodate(folio);

ret |= finish_fault(vmf);
+unlock:
unlock_page(vmf->page);
put_page(vmf->page);
if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY)))
--
2.27.0