Commit eebea5d1 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] target: Fix t_transport_aborted handling in LUN_RESET + active I/O shutdown
parents 7840fea2 52208ae3
...@@ -282,6 +282,9 @@ int core_tmr_lun_reset( ...@@ -282,6 +282,9 @@ int core_tmr_lun_reset(
atomic_set(&task->task_active, 0); atomic_set(&task->task_active, 0);
atomic_set(&task->task_stop, 0); atomic_set(&task->task_stop, 0);
} else {
if (atomic_read(&task->task_execute_queue) != 0)
transport_remove_task_from_execute_queue(task, dev);
} }
__transport_stop_task_timer(task, &flags); __transport_stop_task_timer(task, &flags);
...@@ -301,6 +304,7 @@ int core_tmr_lun_reset( ...@@ -301,6 +304,7 @@ int core_tmr_lun_reset(
DEBUG_LR("LUN_RESET: got t_transport_active = 1 for" DEBUG_LR("LUN_RESET: got t_transport_active = 1 for"
" task: %p, t_fe_count: %d dev: %p\n", task, " task: %p, t_fe_count: %d dev: %p\n", task,
fe_count, dev); fe_count, dev);
atomic_set(&T_TASK(cmd)->t_transport_aborted, 1);
spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock, spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock,
flags); flags);
core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count); core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
...@@ -310,6 +314,7 @@ int core_tmr_lun_reset( ...@@ -310,6 +314,7 @@ int core_tmr_lun_reset(
} }
DEBUG_LR("LUN_RESET: Got t_transport_active = 0 for task: %p," DEBUG_LR("LUN_RESET: Got t_transport_active = 0 for task: %p,"
" t_fe_count: %d dev: %p\n", task, fe_count, dev); " t_fe_count: %d dev: %p\n", task, fe_count, dev);
atomic_set(&T_TASK(cmd)->t_transport_aborted, 1);
spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock, flags); spin_unlock_irqrestore(&T_TASK(cmd)->t_state_lock, flags);
core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count); core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count);
......
...@@ -1207,7 +1207,7 @@ transport_get_task_from_execute_queue(struct se_device *dev) ...@@ -1207,7 +1207,7 @@ transport_get_task_from_execute_queue(struct se_device *dev)
* *
* *
*/ */
static void transport_remove_task_from_execute_queue( void transport_remove_task_from_execute_queue(
struct se_task *task, struct se_task *task,
struct se_device *dev) struct se_device *dev)
{ {
...@@ -5549,7 +5549,8 @@ static void transport_generic_wait_for_tasks( ...@@ -5549,7 +5549,8 @@ static void transport_generic_wait_for_tasks(
atomic_set(&T_TASK(cmd)->transport_lun_stop, 0); atomic_set(&T_TASK(cmd)->transport_lun_stop, 0);
} }
if (!atomic_read(&T_TASK(cmd)->t_transport_active)) if (!atomic_read(&T_TASK(cmd)->t_transport_active) ||
atomic_read(&T_TASK(cmd)->t_transport_aborted))
goto remove; goto remove;
atomic_set(&T_TASK(cmd)->t_transport_stop, 1); atomic_set(&T_TASK(cmd)->t_transport_stop, 1);
...@@ -5956,6 +5957,9 @@ static void transport_processing_shutdown(struct se_device *dev) ...@@ -5956,6 +5957,9 @@ static void transport_processing_shutdown(struct se_device *dev)
atomic_set(&task->task_active, 0); atomic_set(&task->task_active, 0);
atomic_set(&task->task_stop, 0); atomic_set(&task->task_stop, 0);
} else {
if (atomic_read(&task->task_execute_queue) != 0)
transport_remove_task_from_execute_queue(task, dev);
} }
__transport_stop_task_timer(task, &flags); __transport_stop_task_timer(task, &flags);
......
...@@ -135,6 +135,8 @@ extern void transport_complete_task(struct se_task *, int); ...@@ -135,6 +135,8 @@ extern void transport_complete_task(struct se_task *, int);
extern void transport_add_task_to_execute_queue(struct se_task *, extern void transport_add_task_to_execute_queue(struct se_task *,
struct se_task *, struct se_task *,
struct se_device *); struct se_device *);
extern void transport_remove_task_from_execute_queue(struct se_task *,
struct se_device *);
unsigned char *transport_dump_cmd_direction(struct se_cmd *); unsigned char *transport_dump_cmd_direction(struct se_cmd *);
extern void transport_dump_dev_state(struct se_device *, char *, int *); extern void transport_dump_dev_state(struct se_device *, char *, int *);
extern void transport_dump_dev_info(struct se_device *, struct se_lun *, extern void transport_dump_dev_info(struct se_device *, struct se_lun *,
......
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