[SCSI] target: Fix bug with task_sg chained transport_free_dev_tasks release
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 20 May 2011 03:19:11 +0000 (20:19 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 27 May 2011 11:49:31 +0000 (11:49 +0000)
commit42c6951e2f7a665bcb57b92fe3f806ba48152c0e
tree810ac013a9176a8eb24f291ab235b89d74ab4a8f
parent1e7de68c57daf75ec4b721f101f88cccf029e38c
[SCSI] target: Fix bug with task_sg chained transport_free_dev_tasks release

This patch addresses a bug in the target core release path for HW
operation where transport_free_dev_tasks() was incorrectly being called
from transport_lun_remove_cmd() while releasing a se_cmd reference and
calling struct target_core_fabric_ops->queue_data_in().

This would result in a OOPs with HW target mode when the release of
se_task->task_sg[] would happen before pci_unmap_sg() can be called in
HW target mode fabric module code.  This patch addresses the issue by
moving transport_free_dev_tasks() from transport_lun_remove_cmd() into
transport_generic_free_cmd(), and adding TRANSPORT_FREE_CMD_INTR and
transport_generic_free_cmd_intr() to allow se_cmd descriptor release
to happen fromfrom within transport_processing_thread() process context
when release of se_cmd is not possible from HW interrupt context.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
drivers/target/target_core_transport.c
include/target/target_core_base.h
include/target/target_core_transport.h
This page took 0.02471 seconds and 5 git commands to generate.