diff options
author | Wenchao Hao <haowenchao@huawei.com> | 2022-03-04 09:48:49 +0800 |
---|---|---|
committer | Wenchao Hao <haowenchao@huawei.com> | 2022-03-04 09:51:03 +0800 |
commit | 9e914e5648ea836b266ccf4606ecfe56d64a09dd (patch) | |
tree | 9afb741ac591acdc8100fcd3b2c865bd186aeb1c /usr | |
parent | 194bf3a70339e001ea468f0b930ac2011b2d472a (diff) | |
download | open-iscsi-9e914e5648ea836b266ccf4606ecfe56d64a09dd.tar.gz |
initiator:print failure reason of iscsi_send_logout() if failed
print the failure reason of iscsi_send_logout() which is helpful
to locate problem when error happened.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Diffstat (limited to 'usr')
-rw-r--r-- | usr/initiator.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/initiator.c b/usr/initiator.c index bc0908b..7186729 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -1150,8 +1150,11 @@ static void iscsi_stop(void *data) iscsi_ev_context_put(ev_context); if (!(conn->session->t->caps & CAP_LOGIN_OFFLOAD)) { - if (!iscsi_send_logout(conn)) + rc = iscsi_send_logout(conn); + if (!rc) return; + conn_error(conn, "Could not send logout pdu(%s) from iscsi_stop." + "Dropping session", strerror(rc)); } rc = session_conn_shutdown(conn, conn->logout_qtask, ISCSI_SUCCESS); @@ -2142,11 +2145,13 @@ invalid_state: /* LLDs that offload login also offload logout */ if (!(session->t->caps & CAP_LOGIN_OFFLOAD)) { /* unbind is not supported so just do old logout */ - if (!iscsi_send_logout(conn)) + rc = iscsi_send_logout(conn); + if (rc) return ISCSI_SUCCESS; } - conn_error(conn, "Could not send logout pdu. Dropping session"); + conn_error(conn, "Could not send logout pdu(%s) from session_logout_task." + "Dropping session", strerror(rc)); /* fallthrough */ default: rc = session_conn_shutdown(conn, qtask, ISCSI_SUCCESS); |