[Stgt-devel] [Scst-devel] Integration of SCST in themainstreamLinux kernel

FUJITA Tomonori fujita.tomonori
Thu Mar 13 12:32:46 CET 2008


On Thu, 13 Mar 2008 12:24:33 +0100
Tomasz Chmielewski <mangoo at wpkg.org> wrote:

> FUJITA Tomonori schrieb:
> > On Thu, 13 Mar 2008 10:43:42 +0100
> > Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> > 
> >> FUJITA Tomonori schrieb:
> >>
> >>> OK, can you try the following patch?
> >>>
> >>> I've added 'system status':
> >>>
> >>> rose:/home/fujita# ./tgt/usr/tgtadm --op show --mode sys
> >>> System:
> >>>     Status=offline
> >>> iSNS:
> >>>     iSNS=Off
> >>>     iSNSServerIP=
> >>>     iSNSServerPort=3205
> >>>     iSNSAccessControl=Off
> >>>
> >>> If the system status is 'offline', tgtd accepts a new connection and
> >>> then close it.
> >>>
> >>> rose:/home/fujita# ./tgt/usr/tgtadm --op update --mode sys -n state -v
> >>> running
> >>>
> >>> rose:/home/fujita# ./tgt/usr/tgtadm --op show --mode sys
> >>> System:
> >>>     Status=running
> >>> iSNS:
> >>>     iSNS=Off
> >>>     iSNSServerIP=
> >>>     iSNSServerPort=3205
> >>>     iSNSAccessControl=Off
> >>>
> >>> When you finish configuring targets, then change the state to
> >>> 'running'.
> >>>
> >>> The patch is hacky but if it works, I'll clean up and merge it.
> >>>
> >>>
> >>> diff --git a/usr/iscsi/iscsi_tcp.c b/usr/iscsi/iscsi_tcp.c
> >>> index 09ed0e5..c1f97b6 100644
> >>> --- a/usr/iscsi/iscsi_tcp.c
> >>> +++ b/usr/iscsi/iscsi_tcp.c
> >>> @@ -104,6 +104,9 @@ static void accept_connection(int afd, int events, void *data)
> >>>  		return;
> >>>  	}
> >>>  
> >>> +	if (!is_system_available())
> >>> +		goto out;
> >>> +
> >>>  	ret = set_keepalive(fd);
> >>>  	if (ret)
> >>>  		goto out;
> >> Where should I apply this patch? In today's git there is no such thing 
> >> as "ret = set_keepalive(fd);" in usr/iscsi/iscsi_tcp.c.
> > 
> > It's against the git head. I think that there's something wrong with
> > your git tree.
> 
> Indeed. I had an old revision I guess?
> 
> Anyway - the patch works great, iptables are no longer needed!

Nice.


> If the patch is finally integrated, I guess README files need updating, 
> too to reflect the change.

Well, I really don't like to set the default state to 'offline'.

I'm sure that many people say that initiators can connect to tgtd if I
do that.

I could make it as the startup (boot) option though I don't like it
either but I think that it's less problematic to set the default state
to 'offline'.



More information about the stgt mailing list