mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
iscsi: logging improvements for iscsi_scstd.c
Logging improvements for iscsi_scstd.c print more information about failures. Signed-off-by: David Butterfield <dab21774@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7113 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -509,8 +509,11 @@ again:
|
||||
case IOSTATE_READ_BHS:
|
||||
case IOSTATE_READ_AHS_DATA:
|
||||
read_again:
|
||||
errno = 0; /* for the log_debug() */
|
||||
res = read(pollfd->fd, conn->buffer, conn->rwsize);
|
||||
if (res <= 0) {
|
||||
log_debug(1, "read(%u, %p, %u) returned %d, errno=%u",
|
||||
pollfd->fd, conn->buffer, conn->rwsize, res, errno);
|
||||
if (res == 0 || (errno != EINTR && errno != EAGAIN)) {
|
||||
conn->state = STATE_DROP;
|
||||
goto out;
|
||||
@@ -577,6 +580,8 @@ again:
|
||||
conn->cork_transmit(pollfd->fd);
|
||||
res = write(pollfd->fd, conn->buffer, conn->rwsize);
|
||||
if (res < 0) {
|
||||
log_debug(1, "write(%u, %p, %u) returned %d, errno=%u",
|
||||
pollfd->fd, conn->buffer, conn->rwsize, res, errno);
|
||||
if (errno != EINTR && errno != EAGAIN) {
|
||||
conn->state = STATE_DROP;
|
||||
goto out;
|
||||
@@ -747,7 +752,8 @@ static void event_loop(void)
|
||||
(conn->state == STATE_DROP)) {
|
||||
struct session *sess = conn->sess;
|
||||
|
||||
log_debug(1, "closing conn %p", conn);
|
||||
log_debug(1, "closing conn %p state=0x%x fd=%u",
|
||||
conn, conn->state, pollfd->fd);
|
||||
conn_free_pdu(conn);
|
||||
close(pollfd->fd);
|
||||
pollfd->fd = -1;
|
||||
|
||||
Reference in New Issue
Block a user