]> git.baikalelectronics.ru Git - kernel.git/commit
mm/hmm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot}
authorChristoph Hellwig <hch@lst.de>
Wed, 24 Jul 2019 06:52:52 +0000 (08:52 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 25 Jul 2019 19:14:39 +0000 (16:14 -0300)
commit63050454ca103d3b7e6c361b1e71c94bd08f07d2
treec7de00fb18f33e57803a35263197776a1c209cb6
parent3946fc9291da929ed6836ab79a3b87c34d142954
mm/hmm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot}

We should not have two different error codes for the same
condition. EAGAIN must be reserved for the FAULT_FLAG_ALLOW_RETRY retry
case and signals to the caller that the mmap_sem has been unlocked.

Use EBUSY for the !valid case so that callers can get the locking right.

Link: https://lore.kernel.org/r/20190724065258.16603-2-hch@lst.de
Tested-by: Ralph Campbell <rcampbell@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
[jgg: elaborated commit message]
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Documentation/vm/hmm.rst
mm/hmm.c