]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
mm/hmm: do not unconditionally set pfns when returning EBUSY
authorJason Gunthorpe <jgg@mellanox.com>
Fri, 27 Mar 2020 20:00:19 +0000 (17:00 -0300)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 30 Mar 2020 19:58:36 +0000 (16:58 -0300)
commit846babe85efdda49feba5b169668333dcf3edf25
tree9b2f00d245028f5a064ab19f338466111415c84e
parentf66c9a33aee943aa43b3698c1f6f2619e28a1c77
mm/hmm: do not unconditionally set pfns when returning EBUSY

In hmm_vma_handle_pte() and hmm_vma_walk_hugetlb_entry() if fault happens
then -EBUSY will be returned and the pfns input flags will have been
destroyed.

For hmm_vma_handle_pte() set HMM_PFN_NONE only on the success returns that
don't otherwise store to pfns.

For hmm_vma_walk_hugetlb_entry() all exit paths already set pfns, so
remove the redundant store.

Fixes: 2aee09d8c116 ("mm/hmm: change hmm_vma_fault() to allow write fault on page basis")
Link: https://lore.kernel.org/r/20200327200021.29372-8-jgg@ziepe.ca
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
mm/hmm.c