[stgt] [PATCH] tgtd: let conn_close() transfer state of a connection

Hitoshi Mitake mitake.hitoshi at gmail.com
Wed Feb 19 05:13:28 CET 2014


At Mon, 17 Feb 2014 17:12:29 +0900,
Hitoshi Mitake wrote:
> 
> Current tgtd seems to have a possibility that it has a connection
> whose state isn't STATE_CLOSE even after the connection is passed to
> conn_close(). Such a connection is confusing because
> iscsi_scsi_cmd_done() cannot detect the closing of the connection.
> 
> This patch lets conn_close() transfer state of a connection to
> STATE_CLOSE for avoiding this purpose.
> 
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
>  usr/iscsi/conn.c |    2 ++
>  1 file changed, 2 insertions(+)

Please ignore this one. This patch aims to solve the problem which
becomes obvious when the parallelizing PDU send/recv patchset is
applied.

Thanks,
Hitoshi

> 
> diff --git a/usr/iscsi/conn.c b/usr/iscsi/conn.c
> index bb18ac0..cfd6b3e 100644
> --- a/usr/iscsi/conn.c
> +++ b/usr/iscsi/conn.c
> @@ -88,6 +88,8 @@ void conn_close(struct iscsi_connection *conn)
>  	struct iscsi_task *task, *tmp;
>  	int ret;
>  
> +	conn->state = STATE_CLOSE;
> +
>  	if (conn->closed) {
>  		eprintf("already closed %p %u\n", conn, conn->refcount);
>  		return;
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list