Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jul 2017 21:27:32 +0000 (14:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jul 2017 21:27:32 +0000 (14:27 -0700)
Pull SCSI target updates from Nicholas Bellinger:
 "It's been usually busy for summer, with most of the efforts centered
  around TCMU developments and various target-core + fabric driver bug
  fixing activities. Not particularly large in terms of LoC, but lots of
  smaller patches from many different folks.

  The highlights include:

   - ibmvscsis logical partition manager support (Michael Cyr + Bryant
     Ly)

   - Convert target/iblock WRITE_SAME to blkdev_issue_zeroout (hch +
     nab)

   - Add support for TMR percpu LUN reference counting (nab)

   - Fix a potential deadlock between EXTENDED_COPY and iscsi shutdown
     (Bart)

   - Fix COMPARE_AND_WRITE caw_sem leak during se_cmd quiesce (Jiang Yi)

   - Fix TMCU module removal (Xiubo Li)

   - Fix iser-target OOPs during login failure (Andrea Righi + Sagi)

   - Breakup target-core free_device backend driver callback (mnc)

   - Perform TCMU add/delete/reconfig synchronously (mnc)

   - Fix TCMU multiple UIO open/close sequences (mnc)

   - Fix TCMU CHECK_CONDITION sense handling (mnc)

   - Fix target-core SAM_STAT_BUSY + TASK_SET_FULL handling (mnc + nab)

   - Introduce TYPE_ZBC support in PSCSI (Damien Le Moal)

   - Fix possible TCMU memory leak + OOPs when recalculating cmd base
     size (Xiubo Li + Bryant Ly + Damien Le Moal + mnc)

   - Add login_keys_workaround attribute for non RFC initiators (Robert
     LeBlanc + Arun Easi + nab)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (68 commits)
  iscsi-target: Add login_keys_workaround attribute for non RFC initiators
  Revert "qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT"
  tcmu: clean up the code and with one small fix
  tcmu: Fix possbile memory leak / OOPs when recalculating cmd base size
  target: export lio pgr/alua support as device attr
  target: Fix return sense reason in target_scsi3_emulate_pr_out
  target: Fix cmd size for PR-OUT in passthrough_parse_cdb
  tcmu: Fix dev_config_store
  target: pscsi: Introduce TYPE_ZBC support
  target: Use macro for WRITE_VERIFY_32 operation codes
  target: fix SAM_STAT_BUSY/TASK_SET_FULL handling
  target: remove transport_complete
  pscsi: finish cmd processing from pscsi_req_done
  tcmu: fix sense handling during completion
  target: add helper to copy sense to se_cmd buffer
  target: do not require a transport_complete for SCF_TRANSPORT_TASK_SENSE
  target: make device_mutex and device_list static
  tcmu: Fix flushing cmd entry dcache page
  tcmu: fix multiple uio open/close sequences
  tcmu: drop configured check in destroy
  ...

1  2 
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
drivers/scsi/qla2xxx/qla_target.c
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/target_core_file.c
drivers/target/target_core_iblock.c
drivers/target/target_core_pscsi.c
drivers/target/target_core_sbc.c
drivers/target/target_core_transport.c
drivers/vhost/scsi.c
include/scsi/scsi_proto.h

index 2a0173e5d10e1d6095fd659163aabde34a8dca2f,401e245477d4c4c9836c8c55467744f9d7313122..c2dc836dc4843e79ad6239186b650a14f1f91693
@@@ -1874,36 -1847,13 +1874,13 @@@ static int __qlt_24xx_handle_abts(struc
        struct abts_recv_from_24xx *abts, struct fc_port *sess)
  {
        struct qla_hw_data *ha = vha->hw;
-       struct se_session *se_sess = sess->se_sess;
        struct qla_tgt_mgmt_cmd *mcmd;
-       struct qla_tgt_cmd *cmd;
-       struct se_cmd *se_cmd;
        int rc;
-       bool found_lun = false;
-       unsigned long flags;
-       spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);
-       list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) {
-               if (se_cmd->tag == abts->exchange_addr_to_abort) {
-                       found_lun = true;
-                       break;
-               }
-       }
-       spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags);
  
-       /* cmd not in LIO lists, look in qla list */
-       if (!found_lun) {
-               if (abort_cmd_for_tag(vha, abts->exchange_addr_to_abort)) {
-                       /* send TASK_ABORT response immediately */
-                       qlt_24xx_send_abts_resp(ha->base_qpair, abts,
-                           FCP_TMF_CMPL, false);
-                       return 0;
-               } else {
-                       ql_dbg(ql_dbg_tgt_mgt, vha, 0xf081,
-                           "unable to find cmd in driver or LIO for tag 0x%x\n",
-                           abts->exchange_addr_to_abort);
-                       return -ENOENT;
-               }
+       if (abort_cmd_for_tag(vha, abts->exchange_addr_to_abort)) {
+               /* send TASK_ABORT response immediately */
 -              qlt_24xx_send_abts_resp(vha, abts, FCP_TMF_CMPL, false);
++              qlt_24xx_send_abts_resp(ha->base_qpair, abts, FCP_TMF_CMPL, false);
+               return 0;
        }
  
        ql_dbg(ql_dbg_tgt_mgt, vha, 0xf00f,
        }
        memset(mcmd, 0, sizeof(*mcmd));
  
-       cmd = container_of(se_cmd, struct qla_tgt_cmd, se_cmd);
        mcmd->sess = sess;
        memcpy(&mcmd->orig_iocb.abts, abts, sizeof(mcmd->orig_iocb.abts));
 -      mcmd->reset_count = vha->hw->chip_reset;
 +      mcmd->reset_count = ha->base_qpair->chip_reset;
        mcmd->tmr_func = QLA_TGT_ABTS;
 +      mcmd->qpair = ha->base_qpair;
  
-       rc = ha->tgt.tgt_ops->handle_tmr(mcmd, cmd->unpacked_lun, mcmd->tmr_func,
+       /*
+        * LUN is looked up by target-core internally based on the passed
+        * abts->exchange_addr_to_abort tag.
+        */
+       rc = ha->tgt.tgt_ops->handle_tmr(mcmd, 0, mcmd->tmr_func,
            abts->exchange_addr_to_abort);
        if (rc != 0) {
                ql_dbg(ql_dbg_tgt_mgt, vha, 0xf052,
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 8260700d662bbb3db4926f5b7a8c9afd1e999d7e,5e3fe037938e960ddb8fd3dc02cc03b06530320b..8c285d9a06d8a0e285e96e379d7864ee53c3673a
  #define READ_32                     0x09
  #define VERIFY_32           0x0a
  #define WRITE_32            0x0b
+ #define WRITE_VERIFY_32             0x0c
  #define WRITE_SAME_32       0x0d
 +#define ATA_32                      0x1ff0
  
  /* Values for T10/04-262r7 */
  #define       ATA_16                0x85      /* 16-byte pass-thru */