[Stgt-devel] Open connections

FUJITA Tomonori fujita.tomonori
Tue Apr 8 15:48:16 CEST 2008


On Tue, 08 Apr 2008 15:36:52 +0200
Tomasz Chmielewski <mangoo at wpkg.org> wrote:

> FUJITA Tomonori schrieb:
> > On Tue, 08 Apr 2008 14:59:00 +0200
> > Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> > 
> >> FUJITA Tomonori schrieb:
> >>> On Sun, 30 Mar 2008 05:52:16 +0200 (CEST)
> >>> "Niels de Carpentier" <stgt at decarpentier.com> wrote:
> >>>
> >>>>>> So it looks like the cmd_hash_list is not actually cleared on a
> >>>>>> connection
> >>>>>> close.
> >>>>>>
> >>>>>> Is there anything more I can do to troubleshoot this issue?
> >>>>> Can you try this patch?
> >>>> This patch fixes the issue for me.
> >>> Nice, thanks for testing. I've merged the patch.
> >> There is something wrong with the "tgtadm --op show --mode target" 
> >> output - see these files:
> >>
> >> http://wpkg.org/tgt/out1.txt
> >> http://wpkg.org/tgt/out2.txt
> >> http://wpkg.org/tgt/out3.txt
> > 
> > What version do you use, the git head?
> 
> Will this:
> 
>    git clone git://git.kernel.org/pub/scm/linux/kernel/git/tomo/tgt.git
> 
> get me the git head? Because that's what I'm using.

Yeah, you should use the git head. To make sure, try `git-log`, then
you will see:

commit 6a49758ea080ddc095c76d5ccce51e0c911b8e32
Author: Doron Shoham <dorons at voltaire.com>
Date:   Mon Apr 7 16:55:21 2008 +0300

    tgt-setup-lun: fix the usage example

    Signed-off-by: Doron Shoham <dorons at voltaire.com>
    Signed-off-by: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>


> And it "feels" rather unstable - although I can boot a diskless 
> initiator (connect using iscsistart from open-iscsi), it remounts 
> read-only randomly several seconds after we start to read data from the 
> target.

Hmm, that's bad. At least, before apllying this patch, it worked
better (though we had the open connection problem), right?

If so, can you try to revert this patch (for you convenience, I've
attached the patch)?


diff --git a/usr/iscsi/conn.c b/usr/iscsi/conn.c
index 25ad170..0262729 100644
--- a/usr/iscsi/conn.c
+++ b/usr/iscsi/conn.c
@@ -109,7 +109,8 @@ void conn_close(struct iscsi_connection *conn)
 	list_for_each_entry_safe(task, tmp, &conn->tx_clist, c_list) {
 		dprintf("Forcing release of tx task %" PRIx64 "\n",
 			task->tag);
-		iscsi_free_cmd_task(task);
+		list_del(&task->c_list);
+		iscsi_free_task(task);
 	}
 
 	if (conn->rx_task) {
diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c
index fb140e8..bc8a1d5 100644
--- a/usr/iscsi/iscsid.c
+++ b/usr/iscsi/iscsid.c
@@ -1076,7 +1076,7 @@ static inline struct iscsi_task *ITASK(struct scsi_cmd *scmd)
 	return container_of(scmd, struct iscsi_task, scmd);
 }
 
-void iscsi_free_cmd_task(struct iscsi_task *task)
+static void iscsi_free_cmd_task(struct iscsi_task *task)
 {
 	target_cmd_done(&task->scmd);
 
diff --git a/usr/iscsi/iscsid.h b/usr/iscsi/iscsid.h
index 56b0900..7d67727 100644
--- a/usr/iscsi/iscsid.h
+++ b/usr/iscsi/iscsid.h
@@ -267,7 +267,6 @@ extern int iscsi_scsi_cmd_execute(struct iscsi_task *task);
 
 /* iscsid.c iscsi_task */
 extern void iscsi_free_task(struct iscsi_task *task);
-extern void iscsi_free_cmd_task(struct iscsi_task *task);
 
 /* session.c */
 extern struct iscsi_session *session_find_name(int tid, const char *iname, uint8_t *isid);



More information about the stgt mailing list