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

FUJITA Tomonori tomof
Sat Apr 26 10:09:40 CEST 2008


From: FUJITA Tomonori <fujita.tomonori at lab.ntt.co.jp>
Subject: Re: [Stgt-devel] [Scst-devel] Integration of SCST in	themainstreamLinux kernel
Date: Thu, 13 Mar 2008 21:40:24 +0900

> On Thu, 13 Mar 2008 12:44:18 +0100
> Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> 
> > FUJITA Tomonori schrieb:
> > > On Thu, 13 Mar 2008 12:24:33 +0100
> > > Tomasz Chmielewski <mangoo at wpkg.a.org> wrote:
> > 
> > (...)
> > 
> > >> 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.
> > 
> > You meant "can't connect" I guess.
> > Yes, this changes the default behaviour.
> 
> Yeah.
> 
> 
> > > 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'.
> > 
> > Either default to offline (bad for existing users) or give a startup 
> 
> Not only for existing users. People dislike extra operations.
> 
> I've used several commercial iSCSI target systems. All I need to do are
> setting up security (which initiators can connect) and luns with them.
> 
> 
> > option to tgtd (better). There is no other way, I guess (other than 
> > making it compile-time option, which is really bad).
> 
> There is another option. If tgtd has no targets, then tgtd closes a
> connection instead of sending a response. So you can change the state
> to offline, configure targets and then change the state to running.
> 
> Try this patch (against the current git head).
> 
> 
> diff --git a/usr/iscsi/iscsi_tcp.c b/usr/iscsi/iscsi_tcp.c
> index 09ed0e5..ed7879a 100644
> --- a/usr/iscsi/iscsi_tcp.c
> +++ b/usr/iscsi/iscsi_tcp.c
> @@ -104,6 +104,12 @@ static void accept_connection(int afd, int events, void *data)
>  		return;
>  	}
>  
> +	if (!is_system_available())
> +		goto out;
> +
> +	if (list_empty(&iscsi_targets_list))
> +		goto out;
> +
>  	ret = set_keepalive(fd);
>  	if (ret)

I've merged this patch with minor modifications. Play with something
like this:

root at iris:~/git# ./tgt/usr/tgtadm --lld iscsi --op show --mode system
System:
    State: ready
iSNS:
    iSNS=Off
    iSNSServerIP=
    iSNSServerPort=3205
    iSNSAccessControl=Off
root at iris:~/git# ./tgt/usr/tgtadm --op update --mode system -n State -v offline
root at iris:~/git# ./tgt/usr/tgtadm --lld iscsi --op show --mode system
System:
    State: offline
iSNS:
    iSNS=Off
    iSNSServerIP=
    iSNSServerPort=3205
    iSNSAccessControl=Off


Yeah, I know that tgt's user interface is pretty inconsistent so I'll
clean up it.



More information about the stgt mailing list