All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* target: Question about transport_generic_allocate_tasks()
@ 2011-02-12 14:33 Fubo Chen
  2011-02-12 20:10 ` Nicholas A. Bellinger
  0 siblings, 1 reply; 3+ messages in thread
From: Fubo Chen @ 2011-02-12 14:33 UTC (permalink / raw
  To: Nicholas A. Bellinger; +Cc: linux-scsi

Target drivers assume that transport_generic_allocate_tasks() returns
0, -1 or -2. But if transport_generic_allocate_tasks() invoks
transport_generic_cmd_sequencer() and if
transport_generic_cmd_sequencer() invokes core_alua_state_check() the
value 1 can be returned. Which is correct - drivers or core ? And what
is meaning of return values ?

Fubo.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: target: Question about transport_generic_allocate_tasks()
  2011-02-12 14:33 target: Question about transport_generic_allocate_tasks() Fubo Chen
@ 2011-02-12 20:10 ` Nicholas A. Bellinger
  2011-02-13 11:40   ` Fubo Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas A. Bellinger @ 2011-02-12 20:10 UTC (permalink / raw
  To: Fubo Chen; +Cc: linux-scsi

On Sat, 2011-02-12 at 15:33 +0100, Fubo Chen wrote:
> Target drivers assume that transport_generic_allocate_tasks() returns
> 0, -1 or -2. But if transport_generic_allocate_tasks() invoks
> transport_generic_cmd_sequencer() and if
> transport_generic_cmd_sequencer() invokes core_alua_state_check() the
> value 1 can be returned. Which is correct - drivers or core ? And what
> is meaning of return values ?
> 

Hi Fubo,

Note that when 'ret = T10_ALUA(su_dev)->alua_state_check(...)' is non
zero, there are two possible cases:

*) transport_generic_cmd_sequencer() will still 'return -2' when the
   (ret > 0) check is true from ->alua_state_check(...)

*) Or jump to the label out_invalid_cdb_field: that also will
   'return -2'.

So AFAICT transport_generic_cmd_sequencer() will never actually
'return ret' when 'ret = 1';

--nab


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: target: Question about transport_generic_allocate_tasks()
  2011-02-12 20:10 ` Nicholas A. Bellinger
@ 2011-02-13 11:40   ` Fubo Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Fubo Chen @ 2011-02-13 11:40 UTC (permalink / raw
  To: Nicholas A. Bellinger; +Cc: linux-scsi

On Sat, Feb 12, 2011 at 9:10 PM, Nicholas A. Bellinger
<nab@linux-iscsi.org> wrote:
> On Sat, 2011-02-12 at 15:33 +0100, Fubo Chen wrote:
>> Target drivers assume that transport_generic_allocate_tasks() returns
>> 0, -1 or -2. But if transport_generic_allocate_tasks() invoks
>> transport_generic_cmd_sequencer() and if
>> transport_generic_cmd_sequencer() invokes core_alua_state_check() the
>> value 1 can be returned. Which is correct - drivers or core ? And what
>> is meaning of return values ?
>>
>
> Hi Fubo,
>
> Note that when 'ret = T10_ALUA(su_dev)->alua_state_check(...)' is non
> zero, there are two possible cases:
>
> *) transport_generic_cmd_sequencer() will still 'return -2' when the
>   (ret > 0) check is true from ->alua_state_check(...)
>
> *) Or jump to the label out_invalid_cdb_field: that also will
>   'return -2'.
>
> So AFAICT transport_generic_cmd_sequencer() will never actually
> 'return ret' when 'ret = 1';

Thanks for all help. I think other kernel code uses enum { } to assign
name to return values.

Fubo.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-13 11:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-12 14:33 target: Question about transport_generic_allocate_tasks() Fubo Chen
2011-02-12 20:10 ` Nicholas A. Bellinger
2011-02-13 11:40   ` Fubo Chen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.