diff options
author | Christoph Hellwig <hch@lst.de> | 2019-07-24 08:52:52 +0200 |
---|---|---|
committer | Sasha Levin <sashal@kernel.org> | 2019-08-25 10:10:26 -0400 |
commit | 424f6f05714de6462a1c8b1d7e44310e8d6aa0b1 (patch) | |
tree | 2669e13f0ca7261b46d2e807cfd7361733f6a7f4 /Documentation | |
parent | d600580eee7ed1a3c2a7a38d17ecfdd583e7c796 (diff) | |
download | linux-stable-424f6f05714de6462a1c8b1d7e44310e8d6aa0b1.tar.gz linux-stable-424f6f05714de6462a1c8b1d7e44310e8d6aa0b1.tar.bz2 linux-stable-424f6f05714de6462a1c8b1d7e44310e8d6aa0b1.zip |
mm/hmm: always return EBUSY for invalid ranges in hmm_range_{fault,snapshot}
[ Upstream commit 2bcbeaefde2f0384d6ad351c151b1a9fe7791a0a ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/vm/hmm.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/vm/hmm.rst b/Documentation/vm/hmm.rst index 7cdf7282e022..65b6c1109cc8 100644 --- a/Documentation/vm/hmm.rst +++ b/Documentation/vm/hmm.rst @@ -231,7 +231,7 @@ respect in order to keep things properly synchronized. The usage pattern is:: ret = hmm_range_snapshot(&range); if (ret) { up_read(&mm->mmap_sem); - if (ret == -EAGAIN) { + if (ret == -EBUSY) { /* * No need to check hmm_range_wait_until_valid() return value * on retry we will get proper error with hmm_range_snapshot() |