Hannes Reinecke wrote:
> Whenever we send a Data-Out response to an affected LUN during
> LU Reset, we should be setting the 'FINAL' bit. This will
> indicate to the target that we consider this transfer finished.
> 
> Signed-off-by: Hannes Reinecke <h...@suse.de>
> ---
>  drivers/scsi/libiscsi.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
> index a0d1217..16d35f0 100644
> --- a/drivers/scsi/libiscsi.c
> +++ b/drivers/scsi/libiscsi.c
> @@ -321,6 +321,10 @@ static int iscsi_check_tmf_restrictions(struct 
> iscsi_task *task, int opcode)
>                                         task->itt, task->hdr_itt, hdr_lun);
>                       return -EACCES;
>               }
> +             /*
> +              * Set FINAL flag to terminate data transfer.
> +              */
> +             task->hdr->flags |= ISCSI_FLAG_CMD_FINAL;


Wasn't this in the first patch before?

The data-out hdr is not prepd yet.  The entire thing gets memset'd, so 
ORing it does not help.

Plus you only set the F bit for the final PDU. This would send multiple 
PDUs with the final bit set. I think the point of sending a pdu with the 
F bit set is that you do not have to send all the data-outs for the 
sequence (if a tmf was executing then it does not have to wait for MB of 
data). Just send one with the F bit set.

You want to modify iscsi_prep_data_out_pdu to check if a tmf would 
affect that task, and if so then hit the final bit on it. We probably 
also want to indicate to the caller that we ended it early so it it can 
stop sending more data-outs for that r2t.


>               break;
>       case ISCSI_TM_FUNC_ABORT_TASK:
>               /*


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

Reply via email to