]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: iscsi: calling iscsit_stop_session() inside iscsit_close_session()...
authorMaurizio Lombardi <mlombard@redhat.com>
Fri, 13 Mar 2020 17:06:56 +0000 (18:06 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 27 Mar 2020 01:47:47 +0000 (21:47 -0400)
commit600b99853d9419e43e5df53f148e825c18a5d14f
tree8485a2e68d63fe7467dbedb141f539175223de35
parent22d7eab8e6b7c8dd16933d68a3d53e1a9cf82cfe
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.com
Tested-by: Rahul Kundu <rahul.kundu@chelsio.com>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/iscsi/iscsi_target.c