From: Nicholas Bellinger Date: Sat, 25 Feb 2012 09:30:55 +0000 (-0800) Subject: target: Fix target_submit_tmr LUN lookup failures X-Git-Tag: firefly_0821_release~3680^2~3307^2~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3de55ec74aa803d7aa1e581700086d755c2599d2;p=firefly-linux-kernel-4.4.55.git target: Fix target_submit_tmr LUN lookup failures This patch changes target_submit_tmr() LUN lookup failures to set response status TMR_LUN_DOES_NOT_EXIST and invoke TFO->queue_tm_rsp(), instead of sending CHECK_CONDITION status that can cause problems with Linux FCoE clients. Tested with tcm_fc ports and explict LUN_RESET lookup failures. Cc: Andy Grover Cc: Kiran Patil Cc: Arun Easi Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index b79c6a2824ee..d44cbc2113e5 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -1733,8 +1733,8 @@ void target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, ret = transport_lookup_tmr_lun(se_cmd, unpacked_lun); if (ret) { - transport_send_check_condition_and_sense(se_cmd, - se_cmd->scsi_sense_reason, 0); + se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST; + se_cmd->se_tfo->queue_tm_rsp(se_cmd); transport_generic_free_cmd(se_cmd, 0); return; }