提交 626bac73 编写于 作者: M Maurizio Lombardi 提交者: Martin K. Petersen

scsi: target: iscsi: calling iscsit_stop_session() inside iscsit_close_session() has no effect

iscsit_close_session() can only be called when nconn is zero (otherwise a
kernel panic is triggered). If nconn is zero then iscsit_stop_session()
does nothing and exits, so calling it makes no sense.

We still need to call iscsit_check_session_usage_count() because this
function will sleep if the session's refcount is not zero and we don't want
to destroy the session structure if it's still being referenced.

Link: https://lore.kernel.org/r/20200313170656.9716-4-mlombard@redhat.comTested-by: NRahul Kundu <rahul.kundu@chelsio.com>
Signed-off-by: NMaurizio Lombardi <mlombard@redhat.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 57c46e9f
...@@ -4381,8 +4381,7 @@ int iscsit_close_session(struct iscsi_session *sess) ...@@ -4381,8 +4381,7 @@ int iscsit_close_session(struct iscsi_session *sess)
* restart the timer and exit. * restart the timer and exit.
*/ */
if (!in_interrupt()) { if (!in_interrupt()) {
if (iscsit_check_session_usage_count(sess) == 1) iscsit_check_session_usage_count(sess);
iscsit_stop_session(sess, 1, 1);
} else { } else {
if (iscsit_check_session_usage_count(sess) == 2) { if (iscsit_check_session_usage_count(sess) == 2) {
atomic_set(&sess->session_logout, 0); atomic_set(&sess->session_logout, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册