summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6>2005-03-12 19:55:44 +0000
committerdmitry_yus <dmitry_yus@d7303112-9cec-0310-bdd2-e83a94d6c2b6>2005-03-12 19:55:44 +0000
commit7c20bedf36afc39c8fc48dc325f35fadc866f4ef (patch)
treeefd8b4eca104255968a1ec8a30d6c6e1c98c9371
parent9cafc82b6c62ab4c96882e003def43f7e56eb617 (diff)
downloadopen-iscsi-7c20bedf36afc39c8fc48dc325f35fadc866f4ef.tar.gz
refcounting on session create/destroy fix.
git-svn-id: svn://svn.berlios.de/open-iscsi@182 d7303112-9cec-0310-bdd2-e83a94d6c2b6
-rw-r--r--TODO2
-rw-r--r--kernel/iscsi_tcp.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/TODO b/TODO
index 47afa2a..08dbdf3 100644
--- a/TODO
+++ b/TODO
@@ -36,3 +36,5 @@ fixme:
* send_pdu() should use new "anon" poll of mtasks. the anon-mtask will be freed
right after its xmited
* make InitiatorAlias configurable: see get_iscsi_initiatorname()
+* Ming> ./usr/iscsiadm -m discovery -t st -p littleboy.iplink.net
+ iscsiadm: cannot resolve host name littleboy.iplink
diff --git a/kernel/iscsi_tcp.c b/kernel/iscsi_tcp.c
index 0dfdd86..ca4f8e2 100644
--- a/kernel/iscsi_tcp.c
+++ b/kernel/iscsi_tcp.c
@@ -2518,7 +2518,7 @@ iscsi_session_create(iscsi_snx_h handle, uint32_t initial_cmdsn,
host = scsi_host_alloc(&iscsi_sht, sizeof(struct iscsi_session));
if (host == NULL) {
- printk("can not allocate SCSI host for session %p\n",
+ printk("iSCSI: can not allocate SCSI host for session %p\n",
iscsi_ptr(handle));
goto host_alloc_fault;
}
@@ -2567,12 +2567,18 @@ iscsi_session_create(iscsi_snx_h handle, uint32_t initial_cmdsn,
res = scsi_add_host(host, NULL);
if (res) {
- printk("can not add host_no %d (%d)\n", *host_no, res);
+ printk("iSCSI: can not add host_no %d (%d)\n", *host_no, res);
goto add_host_fault;
}
+ if (!try_module_get(THIS_MODULE)) {
+ printk("iSCSI: can not reserve module\n");
+ goto module_get_fault;
+ }
+
return iscsi_handle(session);
+module_get_fault:
add_host_fault:
iscsi_r2tpool_free(session);
r2tpool_alloc_fault:
@@ -2612,6 +2618,7 @@ iscsi_session_destroy(iscsi_snx_h snxh)
iscsi_pool_free(&session->immpool, (void**)session->imm_cmds);
iscsi_pool_free(&session->cmdpool, (void**)session->cmds);
scsi_host_put(session->host);
+ module_put(THIS_MODULE);
}
static int