aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOscar Salvador <[email protected]>2024-05-09 12:01:48 +0200
committerAndrew Morton <[email protected]>2024-05-11 15:41:37 -0700
commit88e4f525002bd3c28fe7a272ffcce743d07c02bd (patch)
treeb0a61002968700286c99ba6b95fa3fbd024be4ba
parent8e34419f4de3eaeed57aee69076105e5d88fbcbe (diff)
mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_wp
commit 1cb9dc4b475c ("mm: hwpoison: support recovery from HugePage copy-on-write faults") added support to use the mc variants when coping hugetlb pages on CoW faults. Add the missing VM_FAULT_SET_HINDEX, so the right si_addr_lsb will be passed to userspace to report the extension of the faulty area. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Oscar Salvador <[email protected]> Acked-by: Peter Xu <[email protected]> Acked-by: Axel Rasmussen <[email protected]> Cc: Liu Shixin <[email protected]> Cc: Muchun Song <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r--mm/hugetlb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 262456daf327..6be78e7d4f6e 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -6067,7 +6067,7 @@ retry_avoidcopy:
goto out_release_all;
if (copy_user_large_folio(new_folio, old_folio, vmf->real_address, vma)) {
- ret = VM_FAULT_HWPOISON_LARGE;
+ ret = VM_FAULT_HWPOISON_LARGE | VM_FAULT_SET_HINDEX(hstate_index(h));
goto out_release_all;
}
__folio_mark_uptodate(new_folio);