summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_tpg.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-05-02 13:45:21 (GMT)
committerNicholas Bellinger <nab@linux-iscsi.org>2016-05-10 08:19:18 (GMT)
commit22d11759a4e7018f8cd7914e4e706ca2c96d6c01 (patch)
tree788d1e4e1828d66f60f9d444c298081013e4d7fa /drivers/target/target_core_tpg.c
parentfba81f8831b20272a97a990e5d47c332e9b1f65d (diff)
downloadlinux-22d11759a4e7018f8cd7914e4e706ca2c96d6c01.tar.xz
target: make ->shutdown_session optional
Turns out the template and thus many drivers got the return value wrong: 0 means the fabrics driver needs to put a session reference, which no driver except for the iSCSI target drivers did. Fortunately none of these drivers supports explicit Node ACLs, so the bug was harmless. Even without that only qla2xxx and iscsi every did real work in shutdown_session, so get rid of the boilerplate code in all other drivers. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_tpg.c')
-rw-r--r--drivers/target/target_core_tpg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c
index b1ac600..a81a370 100644
--- a/drivers/target/target_core_tpg.c
+++ b/drivers/target/target_core_tpg.c
@@ -353,7 +353,10 @@ restart:
list_del_init(&sess->sess_acl_list);
spin_unlock_irqrestore(&acl->nacl_sess_lock, flags);
- ret = acl->se_tpg->se_tpg_tfo->shutdown_session(sess);
+ if (acl->se_tpg->se_tpg_tfo->shutdown_session)
+ ret = acl->se_tpg->se_tpg_tfo->shutdown_session(sess);
+ else
+ ret = 1;
target_put_session(sess);
if (ret)
target_put_session(sess);