summaryrefslogtreecommitdiffstats
path: root/src/blk/kernel
diff options
context:
space:
mode:
authorJoshua Baergen <jbaergen@digitalocean.com>2022-10-12 20:19:36 +0200
committerJoshua Baergen <jbaergen@digitalocean.com>2022-10-12 21:36:36 +0200
commit5e98a6b959b176b8b3a999e28639437976abb476 (patch)
tree6676523a7efc634d7791f187ff1054a17f45831f /src/blk/kernel
parentMerge pull request #48463 from zdover23/wip-doc-2022-10-14-dev-dev-guide-basi... (diff)
downloadceph-5e98a6b959b176b8b3a999e28639437976abb476.tar.xz
ceph-5e98a6b959b176b8b3a999e28639437976abb476.zip
blk/kernel: Fix error code mapping in KernelDevice::read.
pread returns -1 upon error and stores the error code in errno, and thus the wrong error was being passed into is_expected_ioerr. This is handled correctly just a few lines down where we return -errno, so it was likely just an oversight when adapting this logic from the aio codepath, where the return code is indeed the errno. This logic has been incorrect since it was introduced in 2018 via a1e0ece7f987c7a563b25ec0d02fc6f8445ef54e. Signed-off-by: Joshua Baergen <jbaergen@digitalocean.com>
Diffstat (limited to 'src/blk/kernel')
-rw-r--r--src/blk/kernel/KernelDevice.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/blk/kernel/KernelDevice.cc b/src/blk/kernel/KernelDevice.cc
index d9c1e529c07..14b5b415385 100644
--- a/src/blk/kernel/KernelDevice.cc
+++ b/src/blk/kernel/KernelDevice.cc
@@ -1229,7 +1229,7 @@ int KernelDevice::read(uint64_t off, uint64_t len, bufferlist *pbl,
<< "s" << dendl;
}
if (r < 0) {
- if (ioc->allow_eio && is_expected_ioerr(r)) {
+ if (ioc->allow_eio && is_expected_ioerr(-errno)) {
r = -EIO;
} else {
r = -errno;