Skip to content
Commit 2288a9a6 authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

mm/hmm: return -EFAULT when setting HMM_PFN_ERROR on requested valid pages



hmm_range_fault() should never return 0 if the caller requested a valid
page, but the pfns output for that page would be HMM_PFN_ERROR.

hmm_pte_need_fault() must always be called before setting HMM_PFN_ERROR to
detect if the page is in faulting mode or not.

Fix two cases in hmm_vma_walk_pmd() and reorganize some of the duplicated
code.

Fixes: d08faca0 ("mm/hmm: properly handle migration pmd")
Fixes: da4c3c73 ("mm/hmm/mirror: helper to snapshot CPU page table")
Reviewed-by: default avatarRalph Campbell <rcampbell@nvidia.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 76612d6c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment