Skip to content

Commit

Permalink
target: Fix write payload exception handling with ->new_cmd_map
Browse files Browse the repository at this point in the history
This patch fixes a bug for fabrics using tfo->new_cmd_map() that
are expect transport_generic_request_failure() to be calling
transport_send_check_condition_and_sense() for both READ and WRITE,
instead of only for READ exceptions.

This was originally observed with a failed WRITE_SAME_16 w/ unmap=0
using tcm_loop.

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Nicholas Bellinger committed Aug 22, 2011
1 parent 387e96c commit 16ab8e6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,8 +2053,14 @@ static void transport_generic_request_failure(
cmd->scsi_sense_reason = TCM_UNSUPPORTED_SCSI_OPCODE;
break;
}

if (!sc)
/*
* If a fabric does not define a cmd->se_tfo->new_cmd_map caller,
* make the call to transport_send_check_condition_and_sense()
* directly. Otherwise expect the fabric to make the call to
* transport_send_check_condition_and_sense() after handling
* possible unsoliticied write data payloads.
*/
if (!sc && !cmd->se_tfo->new_cmd_map)
transport_new_cmd_failure(cmd);
else {
ret = transport_send_check_condition_and_sense(cmd,
Expand Down

0 comments on commit 16ab8e6

Please sign in to comment.