Re: [PATCH 2/2] iscsi-target: Fix residual count hanlding + remove iscsi_cmd->residual_count

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 16, 2011 at 08:32:21AM +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> 
> This patch fixes iscsi-target handling of underflow where residual data is
> causing an OOPs by using the incorrect iscsi_cmd_t->data_length initially
> assigned in iscsit_allocate_se_cmd().  It resets iscsi_cmd_t->data_length
> from se_cmd_t->data_length after transport_generic_allocate_tasks()
> has been invoked in iscsit_handle_scsi_cmd() RX context, and converts
> iscsi_cmd->residual_count usage to access iscsi_cmd->se_cmd.residual_count
> to get the proper residual count set by target-core.

Can't we simply call iscsi_cmd->data_length, too?  It should always
be the same as the se_cmd->data_length.

> index 3723d90..0e96a6b 100644
> --- a/drivers/target/iscsi/iscsi_target_core.h
> +++ b/drivers/target/iscsi/iscsi_target_core.h
> @@ -398,7 +398,6 @@ struct iscsi_cmd {
>  	u32			pdu_send_order;
>  	/* Current struct iscsi_pdu in struct iscsi_cmd->pdu_list */
>  	u32			pdu_start;
> -	u32			residual_count;
>  	/* Next struct iscsi_seq to send in struct iscsi_cmd->seq_list */
>  	u32			seq_send_order;
>  	/* Number of struct iscsi_seq in struct iscsi_cmd->seq_list */
> -- 
> 1.7.2.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe target-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
---end quoted text---
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux