]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Feb 2015 21:21:19 +0000 (13:21 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 21 Feb 2015 21:21:19 +0000 (13:21 -0800)
Pull SCSI target updates from Nicholas Bellinger:
 "The highlights this round include:

   - Update vhost-scsi to support F_ANY_LAYOUT using mm/iov_iter.c
     logic, and signal VERSION_1 support (MST + Viro + nab)

   - Fix iscsi/iser-target to remove problematic active_ts_set usage
     (Gavin Guo)

   - Update iscsi/iser-target to support multi-sequence sendtargets
     (Sagi)

   - Fix original PR_APTPL_BUF_LEN 8k size limitation (Martin Svec)

   - Add missing WRITE_SAME end-of-device sanity check (Bart)

   - Check for LBA + sectors wrap-around in sbc_parse_cdb() (nab)

   - Other various minor SPC/SBC compliance fixes based upon Ronnie
     Sahlberg test suite (nab)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (32 commits)
  target: Set LBPWS10 bit in Logical Block Provisioning EVPD
  target: Fail UNMAP when emulate_tpu=0
  target: Fail WRITE_SAME w/ UNMAP=1 when emulate_tpws=0
  target: Add sanity checks for DPO/FUA bit usage
  target: Perform PROTECT sanity checks for WRITE_SAME
  target: Fail I/O with PROTECT bit when protection is unsupported
  target: Check for LBA + sectors wrap-around in sbc_parse_cdb
  target: Add missing WRITE_SAME end-of-device sanity check
  iscsi-target: Avoid IN_LOGOUT failure case for iser-target
  target: Fix PR_APTPL_BUF_LEN buffer size limitation
  iscsi-target: Drop problematic active_ts_list usage
  iscsi/iser-target: Support multi-sequence sendtargets text response
  iser-target: Remove duplicate function names
  vhost/scsi: potential memory corruption
  vhost/scsi: Global tcm_vhost -> vhost_scsi rename
  vhost/scsi: Drop left-over scsi_tcq.h include
  vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits
  vhost/scsi: Add ANY_LAYOUT support in vhost_scsi_handle_vq
  vhost/scsi: Add ANY_LAYOUT iov -> sgl mapping prerequisites
  vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len
  ...

1  2 
drivers/target/iscsi/iscsi_target.c
drivers/target/target_core_file.c
drivers/target/target_core_iblock.c
drivers/target/target_core_pr.c
drivers/target/target_core_sbc.c
drivers/target/target_core_spc.c
drivers/vhost/scsi.c
include/target/iscsi/iscsi_target_core.h
include/target/target_core_base.h

index aebde3289c50de6722062dfdea21fa1c549090cd,f533a0dfa4de9ab8778fe738aa4aed5c07e33a6c..50bad55a0c42e3bd9eef6925520cb1e9bddf2209
@@@ -3509,10 -3522,12 +3522,12 @@@ iscsit_build_sendtargets_response(struc
                }
                spin_unlock(&tiqn->tiqn_tpg_lock);
  eob:
-               if (end_of_buf)
+               if (end_of_buf) {
+                       *completed = false;
                        break;
+               }
  
 -              if (cmd->cmd_flags & IFC_SENDTARGETS_SINGLE)
 +              if (cmd->cmd_flags & ICF_SENDTARGETS_SINGLE)
                        break;
        }
        spin_unlock(&tiqn_lock);
Simple merge
Simple merge
Simple merge
index cd4bed7b27579b14a0f6e517eed23dacb6c1fe02,9661a6626b2d761bc2f4966db19a0d27f38a401b..9a2f9d3a6e70514ad9351ab6e144709e8b95f91d
@@@ -953,9 -1032,25 +1032,10 @@@ sbc_parse_cdb(struct se_cmd *cmd, struc
  
        if (cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) {
                unsigned long long end_lba;
 -
 -              if (sectors > dev->dev_attrib.fabric_max_sectors) {
 -                      printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
 -                              " big sectors %u exceeds fabric_max_sectors:"
 -                              " %u\n", cdb[0], sectors,
 -                              dev->dev_attrib.fabric_max_sectors);
 -                      return TCM_INVALID_CDB_FIELD;
 -              }
 -              if (sectors > dev->dev_attrib.hw_max_sectors) {
 -                      printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
 -                              " big sectors %u exceeds backend hw_max_sectors:"
 -                              " %u\n", cdb[0], sectors,
 -                              dev->dev_attrib.hw_max_sectors);
 -                      return TCM_INVALID_CDB_FIELD;
 -              }
  check_lba:
                end_lba = dev->transport->get_blocks(dev) + 1;
-               if (cmd->t_task_lba + sectors > end_lba) {
+               if (((cmd->t_task_lba + sectors) < cmd->t_task_lba) ||
+                   ((cmd->t_task_lba + sectors) > end_lba)) {
                        pr_err("cmd exceeds last lba %llu "
                                "(lba %llu, sectors %u)\n",
                                end_lba, cmd->t_task_lba, sectors);
Simple merge
index dc78d87e0fc2c5e14832adf674899823ac223c5f,ab4811f749f519e8949df19ae40679e940034b31..8d4f3f1ff799fb1d7b4bb5a2184144b515676a2c
@@@ -911,28 -921,11 +921,28 @@@ vhost_scsi_mapal(struct vhost_scsi_cmd 
        return 0;
  }
  
- static void tcm_vhost_submission_work(struct work_struct *work)
 +static int vhost_scsi_to_tcm_attr(int attr)
 +{
 +      switch (attr) {
 +      case VIRTIO_SCSI_S_SIMPLE:
 +              return TCM_SIMPLE_TAG;
 +      case VIRTIO_SCSI_S_ORDERED:
 +              return TCM_ORDERED_TAG;
 +      case VIRTIO_SCSI_S_HEAD:
 +              return TCM_HEAD_TAG;
 +      case VIRTIO_SCSI_S_ACA:
 +              return TCM_ACA_TAG;
 +      default:
 +              break;
 +      }
 +      return TCM_SIMPLE_TAG;
 +}
 +
+ static void vhost_scsi_submission_work(struct work_struct *work)
  {
-       struct tcm_vhost_cmd *cmd =
-               container_of(work, struct tcm_vhost_cmd, work);
-       struct tcm_vhost_nexus *tv_nexus;
+       struct vhost_scsi_cmd *cmd =
+               container_of(work, struct vhost_scsi_cmd, work);
+       struct vhost_scsi_nexus *tv_nexus;
        struct se_cmd *se_cmd = &cmd->tvc_se_cmd;
        struct scatterlist *sg_ptr, *sg_prot_ptr = NULL;
        int rc;
Simple merge