Skip to contentSkip to conversation

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

PATCH Superseded Maurizio Lombardi 1 participant 1 message Mar 13, 2020 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 iscsi target: 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.

---
 drivers/target/iscsi/iscsi_target.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/target/iscsi/iscsi_target.c +1 -2
index 9e90edc875f1..14f4842e3517 100644
@@ -4385,8 +4385,7 @@ int iscsit_close_session(struct iscsi_session *sess)
 	 * restart the timer and exit.
 	 */
 	if (!in_interrupt()) {
-		if (iscsit_check_session_usage_count(sess) == 1)
-			iscsit_stop_session(sess, 1, 1);
+		iscsit_check_session_usage_count(sess);
 	} else {
 		if (iscsit_check_session_usage_count(sess) == 2) {
 			atomic_set(&sess->session_logout, 0);
Signature · 1 line
2.21.0