iscsi: simplify nesting and order in iscsi_conn_read_data()
Try to make the logic of the function a little clearer. Change-Id: Ic78bed73feef94d94487f0a4240019789be8d2bc Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-on: https://review.gerrithub.io/414353 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
edf924824e
commit
feb7f2b3fc
@ -732,12 +732,14 @@ spdk_iscsi_conn_read_data(struct spdk_iscsi_conn *conn, int bytes,
|
||||
|
||||
if (ret > 0) {
|
||||
spdk_trace_record(TRACE_READ_FROM_SOCKET_DONE, conn->id, ret, 0, 0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (ret < 0) {
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
|
||||
/* For connect reset issue, do not output error log */
|
||||
if (errno == ECONNRESET) {
|
||||
SPDK_DEBUGLOG(SPDK_LOG_ISCSI, "spdk_sock_recv() failed, errno %d: %s\n",
|
||||
@ -747,17 +749,11 @@ spdk_iscsi_conn_read_data(struct spdk_iscsi_conn *conn, int bytes,
|
||||
errno, spdk_strerror(errno));
|
||||
}
|
||||
}
|
||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||
}
|
||||
|
||||
/* connection closed */
|
||||
if (ret == 0) {
|
||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
spdk_iscsi_task_mgmt_cpl(struct spdk_scsi_task *scsi_task)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user