Commit 415a090a authored by Nicholas Bellinger's avatar Nicholas Bellinger

target: Fix incorrect transport_sent usage

This patch converts target-core to use se_cmd->t_transport_sent instead of
a duplicated se_cmd->transport_sent member in a handful of locations.
It also updates iscsi_target to properly use ->t_transport_sent instead of
it's own iscsi_cmd_t->transport_sent value that was not being assigned.
Reported-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent af3f00c7
...@@ -428,7 +428,6 @@ struct iscsi_cmd { ...@@ -428,7 +428,6 @@ struct iscsi_cmd {
/* Number of times struct iscsi_cmd is present in immediate queue */ /* Number of times struct iscsi_cmd is present in immediate queue */
atomic_t immed_queue_count; atomic_t immed_queue_count;
atomic_t response_queue_count; atomic_t response_queue_count;
atomic_t transport_sent;
spinlock_t datain_lock; spinlock_t datain_lock;
spinlock_t dataout_timeout_lock; spinlock_t dataout_timeout_lock;
/* spinlock for protecting struct iscsi_cmd->i_state */ /* spinlock for protecting struct iscsi_cmd->i_state */
......
...@@ -250,7 +250,7 @@ static int iscsit_task_reassign_complete_write( ...@@ -250,7 +250,7 @@ static int iscsit_task_reassign_complete_write(
* so if we have received all DataOUT we can safety ignore Initiator. * so if we have received all DataOUT we can safety ignore Initiator.
*/ */
if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) { if (cmd->cmd_flags & ICF_GOT_LAST_DATAOUT) {
if (!atomic_read(&cmd->transport_sent)) { if (!atomic_read(&cmd->se_cmd.t_transport_sent)) {
pr_debug("WRITE ITT: 0x%08x: t_state: %d" pr_debug("WRITE ITT: 0x%08x: t_state: %d"
" never sent to transport\n", " never sent to transport\n",
cmd->init_task_tag, cmd->se_cmd.t_state); cmd->init_task_tag, cmd->se_cmd.t_state);
...@@ -314,7 +314,7 @@ static int iscsit_task_reassign_complete_read( ...@@ -314,7 +314,7 @@ static int iscsit_task_reassign_complete_read(
cmd->acked_data_sn = (tmr_req->exp_data_sn - 1); cmd->acked_data_sn = (tmr_req->exp_data_sn - 1);
} }
if (!atomic_read(&cmd->transport_sent)) { if (!atomic_read(&cmd->se_cmd.t_transport_sent)) {
pr_debug("READ ITT: 0x%08x: t_state: %d never sent to" pr_debug("READ ITT: 0x%08x: t_state: %d never sent to"
" transport\n", cmd->init_task_tag, " transport\n", cmd->init_task_tag,
cmd->se_cmd.t_state); cmd->se_cmd.t_state);
......
...@@ -2294,7 +2294,7 @@ static int __transport_execute_tasks(struct se_device *dev) ...@@ -2294,7 +2294,7 @@ static int __transport_execute_tasks(struct se_device *dev)
if (atomic_read(&cmd->t_task_cdbs_sent) == if (atomic_read(&cmd->t_task_cdbs_sent) ==
cmd->t_task_list_num) cmd->t_task_list_num)
atomic_set(&cmd->transport_sent, 1); atomic_set(&cmd->t_transport_sent, 1);
transport_start_task_timer(task); transport_start_task_timer(task);
spin_unlock_irqrestore(&cmd->t_state_lock, flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags);
...@@ -2311,7 +2311,7 @@ static int __transport_execute_tasks(struct se_device *dev) ...@@ -2311,7 +2311,7 @@ static int __transport_execute_tasks(struct se_device *dev)
task->task_flags &= ~TF_ACTIVE; task->task_flags &= ~TF_ACTIVE;
spin_unlock_irqrestore(&cmd->t_state_lock, flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags);
del_timer_sync(&task->task_timer); del_timer_sync(&task->task_timer);
atomic_set(&cmd->transport_sent, 0); atomic_set(&cmd->t_transport_sent, 0);
transport_stop_tasks_for_cmd(cmd); transport_stop_tasks_for_cmd(cmd);
atomic_inc(&dev->depth_left); atomic_inc(&dev->depth_left);
transport_generic_request_failure(cmd, 0, 1); transport_generic_request_failure(cmd, 0, 1);
...@@ -2351,7 +2351,7 @@ static int __transport_execute_tasks(struct se_device *dev) ...@@ -2351,7 +2351,7 @@ static int __transport_execute_tasks(struct se_device *dev)
task->task_flags &= ~TF_ACTIVE; task->task_flags &= ~TF_ACTIVE;
spin_unlock_irqrestore(&cmd->t_state_lock, flags); spin_unlock_irqrestore(&cmd->t_state_lock, flags);
del_timer_sync(&task->task_timer); del_timer_sync(&task->task_timer);
atomic_set(&cmd->transport_sent, 0); atomic_set(&cmd->t_transport_sent, 0);
transport_stop_tasks_for_cmd(cmd); transport_stop_tasks_for_cmd(cmd);
atomic_inc(&dev->depth_left); atomic_inc(&dev->depth_left);
transport_generic_request_failure(cmd, 0, 1); transport_generic_request_failure(cmd, 0, 1);
......
...@@ -439,7 +439,6 @@ struct se_cmd { ...@@ -439,7 +439,6 @@ struct se_cmd {
u32 orig_fe_lun; u32 orig_fe_lun;
/* Persistent Reservation key */ /* Persistent Reservation key */
u64 pr_res_key; u64 pr_res_key;
atomic_t transport_sent;
/* Used for sense data */ /* Used for sense data */
void *sense_buffer; void *sense_buffer;
struct list_head se_delayed_node; struct list_head se_delayed_node;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment