nvme_disk: Trace I/O errors to syslog.

This really should never occur, but in case it does, whoever called
us may not print such an error, so we should.
This commit is contained in:
Augustin Cavalier 2019-06-29 13:22:26 -04:00
parent b2de0c59cb
commit e2aa2b55a7

View File

@ -345,13 +345,19 @@ do_nvme_io(nvme_disk_driver_info* info, off_t rounded_pos, void* buffer,
(nvme_cmd_cb)disk_io_callback, &status, 0);
}
mutex_unlock(&qpinfo->mtx);
if (ret != 0)
if (ret != 0) {
TRACE_ERROR("attempt to queue %s I/O at %" B_PRIdOFF " of %" B_PRIuSIZE
" bytes failed!", write ? "write" : "read", rounded_pos, *rounded_len);
return ret;
}
await_status(qpinfo->qpair, status);
if (status != B_OK)
if (status != B_OK) {
TRACE_ERROR("%s at %" B_PRIdOFF " of %" B_PRIuSIZE " bytes failed!",
write ? "write" : "read", rounded_pos, *rounded_len);
*rounded_len = 0;
}
return status;
}