]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
blk/kernel: Fix error code mapping in KernelDevice::read. 49984/head
authorJoshua Baergen <jbaergen@digitalocean.com>
Wed, 12 Oct 2022 18:19:36 +0000 (12:19 -0600)
committerIgor Fedotov <igor.fedotov@croit.io>
Fri, 3 Feb 2023 09:39:52 +0000 (12:39 +0300)
commit17c20f0da3d3f749aef68b79d8994df2bd34eeea
tree6deb4fe90cf5c1729056a769de9247071d6e232d
parent2f84f45b7640ebca17cf43b4c256f52ce47e22bb
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>
(cherry picked from commit 5e98a6b959b176b8b3a999e28639437976abb476)
src/blk/kernel/KernelDevice.cc