Re: [PATCH 2/3] tcm/pscsi: Add proper BIDI-COMMAND passthrough toSCSI MidLayer

From: Boaz Harrosh
Date: Wed Sep 22 2010 - 07:35:12 EST


On 09/22/2010 01:13 PM, Boaz Harrosh wrote:
> On 09/22/2010 08:08 AM, Nicholas A. Bellinger wrote:

<snip>

>> return task->task_sg_num;
>
> OK Now I'm sure!
> You have completely missed the fact that bidi entails two sg_list(s)
> two sg_num(s) and two io_byte_count(s).
>
> The use of sg_table will clear that confusion a bit, though I wanted it
> to carry an io_byte_count as well, but never came to do that.
>

OK actually you should use scsi_data_buffer better then sg_table. Because
it also has the length. And it even has a resid. Because with bidi-commands
there are two residual counters reported in command-response. You can see
libiscsi for how it handles the bidi residual counters.

Boaz
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/