diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 08:02:48 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 21:38:41 -0500 |
commit | 9f0d05c2c6185d7b5ba08a6c052e90837101031f (patch) | |
tree | 3ea308edfd01d79d2b87ea9496fcb02445a77d13 /drivers/target | |
parent | 00ad4c4e81ba8bfcc52c42ec9d72ff84a081fb82 (diff) |
target: Push target_submit_tmr LUN lookup failure to system_wq context
In order to handle incoming target_submit_tmr() callers using interrupt
context, use system_wq process context for transport_lookup_tmr_lun()
failures to return TMR_LUN_DOES_NOT_EXIST status for fabric TM response.
Cc: Andy Grover <agrover@redhat.com>
Cc: Kiran Patil <kiran.patil@intel.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 96e78f3f461d..ca1a40dc4888 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -1694,6 +1694,15 @@ void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, | |||
1694 | } | 1694 | } |
1695 | EXPORT_SYMBOL(target_submit_cmd); | 1695 | EXPORT_SYMBOL(target_submit_cmd); |
1696 | 1696 | ||
1697 | static void target_complete_tmr_failure(struct work_struct *work) | ||
1698 | { | ||
1699 | struct se_cmd *se_cmd = container_of(work, struct se_cmd, work); | ||
1700 | |||
1701 | se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST; | ||
1702 | se_cmd->se_tfo->queue_tm_rsp(se_cmd); | ||
1703 | transport_generic_free_cmd(se_cmd, 0); | ||
1704 | } | ||
1705 | |||
1697 | /** | 1706 | /** |
1698 | * target_submit_tmr - lookup unpacked lun and submit uninitialized se_cmd | 1707 | * target_submit_tmr - lookup unpacked lun and submit uninitialized se_cmd |
1699 | * for TMR CDBs | 1708 | * for TMR CDBs |
@@ -1734,9 +1743,12 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, | |||
1734 | 1743 | ||
1735 | ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); | 1744 | ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); |
1736 | if (ret) { | 1745 | if (ret) { |
1737 | se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST; | 1746 | /* |
1738 | se_cmd->se_tfo->queue_tm_rsp(se_cmd); | 1747 | * For callback during failure handling, push this work off |
1739 | transport_generic_free_cmd(se_cmd, 0); | 1748 | * to process context with TMR_LUN_DOES_NOT_EXIST status. |
1749 | */ | ||
1750 | INIT_WORK(&se_cmd->work, target_complete_tmr_failure); | ||
1751 | schedule_work(&se_cmd->work); | ||
1740 | return 0; | 1752 | return 0; |
1741 | } | 1753 | } |
1742 | transport_generic_handle_tmr(se_cmd); | 1754 | transport_generic_handle_tmr(se_cmd); |