From: Andy Grover <agrover@xxxxxxxxxx> Increment makes it seem like t_task_cdbs could've had a nonzero value before, that we want to preserve. This does not seem to ever be the case, since there is no looping in transport_new_cmd_obj. Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> --- drivers/target/target_core_transport.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index df9a9a2..da6bd74 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -4009,11 +4009,12 @@ static int transport_get_sectors(struct se_cmd *cmd) static int transport_new_cmd_obj(struct se_cmd *cmd) { struct se_device *dev = cmd->se_dev; - u32 task_cdbs = 0, rc; + u32 task_cdbs; + u32 rc; if (!(cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB)) { - task_cdbs++; - cmd->t_task.t_task_cdbs++; + task_cdbs = 1; + cmd->t_task.t_task_cdbs = 1; } else { int set_counts = 1; @@ -4052,7 +4053,7 @@ static int transport_new_cmd_obj(struct se_cmd *cmd) TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; return PYX_TRANSPORT_LU_COMM_FAILURE; } - cmd->t_task.t_task_cdbs += task_cdbs; + cmd->t_task.t_task_cdbs = task_cdbs; #if 0 printk(KERN_INFO "data_length: %u, LBA: %llu t_tasks_sectors:" -- 1.7.6 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html