Logging proper message during read error from disk

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
This commit is contained in:
Somnath Roy 2016-09-10 16:28:32 -04:00
parent 46f1f9e5ca
commit 14c00baa20

View File

@ -509,6 +509,8 @@ int KernelDevice::direct_read_unaligned(uint64_t off, uint64_t len, char *buf)
r = ::pread(fd_direct, p.c_str(), aligned_len, aligned_off);
if (r < 0) {
r = -errno;
derr << __func__ << " 0x" << std::hex << off << "~" << len << std::dec
<< " error: " << cpp_strerror(r) << dendl;
goto out;
}
assert((uint64_t)r == aligned_len);
@ -548,6 +550,8 @@ int KernelDevice::read_random(uint64_t off, uint64_t len, char *buf,
r = ::pread(fd_buffered, t, left, off);
if (r < 0) {
r = -errno;
derr << __func__ << " 0x" << std::hex << off << "~" << left
<< std::dec << " error: " << cpp_strerror(r) << dendl;
goto out;
}
off += r;
@ -559,6 +563,9 @@ int KernelDevice::read_random(uint64_t off, uint64_t len, char *buf,
r = ::pread(fd_direct, buf, len, off);
if (r < 0) {
r = -errno;
derr << __func__ << " direct_aligned_read" << " 0x" << std::hex
<< off << "~" << left << std::dec << " error: " << cpp_strerror(r)
<< dendl;
goto out;
}
assert((uint64_t)r == len);