Skip to content

Commit 88e4f52

Browse files
osalvadorvilardagaakpm00
authored andcommitted
mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_wp
commit 1cb9dc4 ("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/20240509100148.22384-3-osalvador@suse.de Signed-off-by: Oscar Salvador <osalvador@suse.de> Acked-by: Peter Xu <peterx@redhat.com> Acked-by: Axel Rasmussen <axelrasmussen@google.com> Cc: Liu Shixin <liushixin2@huawei.com> Cc: Muchun Song <muchun.song@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 8e34419 commit 88e4f52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/hugetlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6067,7 +6067,7 @@ static vm_fault_t hugetlb_wp(struct folio *pagecache_folio,
60676067
goto out_release_all;
60686068

60696069
if (copy_user_large_folio(new_folio, old_folio, vmf->real_address, vma)) {
6070-
ret = VM_FAULT_HWPOISON_LARGE;
6070+
ret = VM_FAULT_HWPOISON_LARGE | VM_FAULT_SET_HINDEX(hstate_index(h));
60716071
goto out_release_all;
60726072
}
60736073
__folio_mark_uptodate(new_folio);

0 commit comments

Comments
 (0)