[Stgt-devel] [Scst-devel] Integration of SCST in the mainstream Linux kernel

Tomasz Chmielewski mangoo
Mon Mar 10 13:17:39 CET 2008


FUJITA Tomonori schrieb:
> On Mon, 10 Mar 2008 11:48:09 +0100
> Tomasz Chmielewski <mangoo at wpkg.org> wrote:
> 
>> FUJITA Tomonori schrieb:
>>
>> (...)
>>
>>>> But it looks that there is still this issue then - so it may fail sometimes:
>>>>
>>>>   there is a race
>>>>   between the first and second operations (that is, you need to peform
>>>>   the second right after the first, before the initiator tries to
>>>>   connect). I'm fine with changing the default state to 'offline'.
>>>>
>>>> ?
>>> Then, at least, try that to see it works for you. After that, you can
>>> say something like, it works for me, but I want the default state
>>> 'offline'.
>> No, it doesn't work for me because of the race mentioned above, or, 
>> described once again, below - this is what happens to the target and 
>> initiator if we want to restart the target (i.e., target software 
>> upgrade or target machine restart, because of kernel, hardware upgrade 
>> etc.):
> 
> Can you try the following patch works with the latest git:
> 
> diff --git a/usr/target.c b/usr/target.c
> index 50769f6..89f90cb 100644
> --- a/usr/target.c
> +++ b/usr/target.c
> @@ -1636,7 +1636,7 @@ int tgt_target_create(int lld, int tid, char *args)
>  
>  	target->bst = bst;
>  
> -	target->target_state = SCSI_TARGET_RUNNING;
> +	target->target_state = SCSI_TARGET_OFFLINE;
>  	target->lid = lld;
>  
>  	list_for_each_entry(pos, &target_list, target_siblings)

No, it doesn't solve this problem.

The thing is, when tgtd is (re)started, it has no targets configured, 
but it already listens and accepts incoming connections.

So if an initiator reconnects to tgtd, tgtd can't reply:

   target iqn.2001-04.com.example:storage.disk2.iris.sys1.xyz offlined
   try again later

because there are no targets configured.

Instead, it still replies "no such target", and the initiator which 
reconnects reports an IO error.



-- 
Tomasz Chmielewski
http://wpkg.org




More information about the stgt mailing list