Skip to content

Commit

Permalink
iscsi-target: Fix iscsit_add_reject* usage for iser
Browse files Browse the repository at this point in the history
This patch changes iscsit_add_reject() + iscsit_add_reject_from_cmd()
usage to not sleep on iscsi_cmd->reject_comp to address a free-after-use
usage bug in v3.10 with iser-target code.

It saves ->reject_reason for use within iscsit_build_reject() so the
correct value for both transport cases.  It also drops the legacy
fail_conn parameter usage throughput iscsi-target code and adds
two iscsit_add_reject_cmd() and iscsit_reject_cmd helper functions,
along with various small cleanups.

(v2: Re-enable target_put_sess_cmd() to be called from
     iscsit_add_reject_from_cmd() for rejects invoked after
     target_get_sess_cmd() has been called)

Cc: Or Gerlitz <ogerlitz@mellanox.com>
Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: stable@vger.kernel.org  # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
nablio3000 committed Jul 7, 2013
1 parent 3df8f68 commit ba15991
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 180 deletions.
5 changes: 0 additions & 5 deletions drivers/infiniband/ulp/isert/ib_isert.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,11 +939,6 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn,
if (!rc && dump_payload == false && unsol_data)
iscsit_set_unsoliticed_dataout(cmd);

if (rc == CMDSN_ERROR_CANNOT_RECOVER)
return iscsit_add_reject_from_cmd(
ISCSI_REASON_PROTOCOL_ERROR,
1, 0, (unsigned char *)hdr, cmd);

return 0;
}

Expand Down
Loading

0 comments on commit ba15991

Please sign in to comment.