[PATCH v2 hmm 8/9] mm/hmm: do not set pfns when returning an error code
Christoph Hellwig
hch at lst.de
Tue Mar 24 07:38:29 UTC 2020
On Mon, Mar 23, 2020 at 10:14:56PM -0300, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <jgg at mellanox.com>
>
> Most places that return an error code, like -EFAULT, do not set
> HMM_PFN_ERROR, only two places do this.
>
> Resolve this inconsistency by never setting the pfns on an error
> exit. This doesn't seem like a worthwhile thing to do anyhow.
>
> If for some reason it becomes important, it makes more sense to directly
> return the address of the failing page rather than have the caller scan
> for the HMM_PFN_ERROR.
>
> No caller inspects the pnfs output array if hmm_range_fault() fails.
>
> Signed-off-by: Jason Gunthorpe <jgg at mellanox.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch at lst.de>
More information about the amd-gfx
mailing list