Jason Gunthorpe be957c886d mm/hmm: make hmm_range_fault return 0 or -1
hmm_vma_walk->last is supposed to be updated after every write to the
pfns, so that it can be returned by hmm_range_fault(). However, this is
not done consistently. Fortunately nothing checks the return code of
hmm_range_fault() for anything other than error.

More importantly last must be set before returning -EBUSY as it is used to
prevent reading an output pfn as an input flags when the loop restarts.

For clarity and simplicity make hmm_range_fault() return 0 or -ERRNO. Only
set last when returning -EBUSY.

Link: https://lore.kernel.org/r/2-v2-b4e84f444c7d+24f57-hmm_no_flags_jgg@mellanox.com
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Tested-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
2020-05-11 10:47:29 -03:00
..
2020-04-10 15:36:21 -07:00
2019-08-30 22:43:58 -07:00
2020-04-07 10:43:41 -07:00
2020-04-08 21:03:40 -07:00
2020-02-04 03:05:25 +00:00
2020-04-07 10:43:41 -07:00
2020-04-07 10:43:38 -07:00
2020-04-10 15:36:21 -07:00
2020-04-10 15:36:21 -07:00
2020-04-08 21:03:40 -07:00
2020-04-10 15:36:21 -07:00
2020-04-10 15:36:21 -07:00
2020-03-21 18:56:06 -07:00
2020-04-07 10:43:38 -07:00
2019-09-17 15:20:17 -07:00
2020-04-07 10:43:38 -07:00
2020-04-07 10:43:41 -07:00