1. 06 9月, 2012 2 次提交
  2. 27 8月, 2012 1 次提交
  3. 24 8月, 2012 1 次提交
    • N
      target: Fix ->data_length re-assignment bug with SCSI overflow · 4c054ba6
      Nicholas Bellinger 提交于
      This patch fixes a long-standing bug with SCSI overflow handling
      where se_cmd->data_length was incorrectly being re-assigned to
      the larger CDB extracted allocation length, resulting in a number
      of fabric level errors that would end up causing a session reset
      in most cases.  So instead now:
      
       - Only re-assign se_cmd->data_length durining UNDERFLOW (to use the
         smaller value)
       - Use existing se_cmd->data_length for OVERFLOW (to use the smaller
         value)
      
      This fix has been tested with the following CDB to generate an
      SCSI overflow:
      
        sg_raw -r512 /dev/sdc 28 0 0 0 0 0 0 0 9 0
      
      Tested using iscsi-target, tcm_qla2xxx, loopback and tcm_vhost fabric
      ports.  Here is a bit more detail on each case:
      
       - iscsi-target: Bug with open-iscsi with overflow, sg_raw returns
                       -3584 bytes of data.
       - tcm_qla2xxx: Working as expected, returnins 512 bytes of data
       - loopback: sg_raw returns CHECK_CONDITION, from overflow rejection
                   in transport_generic_map_mem_to_cmd()
       - tcm_vhost: Same as loopback
      Reported-by: NRoland Dreier <roland@purestorage.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      4c054ba6
  4. 22 8月, 2012 1 次提交
  5. 21 8月, 2012 2 次提交
  6. 18 8月, 2012 1 次提交
    • N
      target: Fix regression bug with handling of zero-length data CDBs · 74f4cf29
      Nicholas Bellinger 提交于
      This patch fixes a regression bug with the handling of zero-length
      data CDBs within transport_generic_new_cmd() code.  The bug was introduced
      with the following commit as part of the single task conversion work:
      
        commit 4101f0a8
        Author: Christoph Hellwig <hch@infradead.org>
        Date:   Tue Apr 24 00:25:03 2012 -0400
      
            target: always allocate a single task
      
      where the zero-length check for SCF_SCSI_DATA_SG_IO_CDB was incorrectly
      changed to SCF_SCSI_CONTROL_SG_IO_CDB because of the seperate comment
      in transport_generic_new_cmd() wrt to control CDBs zero-length handling
      introduced in:
      
        commit 91ec1d35
        Author: Nicholas Bellinger <nab@linux-iscsi.org>
        Date:   Fri Jan 13 12:01:34 2012 -0800
      
            target: Add workaround for zero-length control CDB handling
      
      So go ahead and change transport_generic_new_cmd() to handle control+data
      zero-length CDBs in the same manner for this special case.
      
      Tested with iscsi-target + loopback fabric port LUNs on 3.6-rc0 code.
      
      This patch will also need to be picked up for 3.5-stable.
      
      (hch: Add proper comment in transport_generic_new_cmd)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      74f4cf29
  7. 17 8月, 2012 6 次提交
    • N
      target/pscsi: Fix bug with REPORT_LUNs handling for SCSI passthrough · 1d2a2cd9
      Nicholas Bellinger 提交于
      This patch fixes a regression bug in pscsi_transport_complete() callback
      code where *pt was being NULL dereferenced during REPORT_LUNS handling,
      that was introduced with the spc/sbc refactoring in:
      
      commit 1fd032ee
      Author: Christoph Hellwig <hch@infradead.org>
      Date:   Sun May 20 11:59:15 2012 -0400
      
          target: move code for CDB emulation
      
      As this is a special case for pscsi_parse_cdb() to call spc_parse_cdb() to
      allow TCM to handle REPORT_LUN emulation, pscsi_plugin_task will have not
      been allocated..
      
      So now in pscsi_transport_complete() just check for existence of *pt and
      return for this special case.
      Reported-by: NAlex Elsayed <eternaleye+usenet@gmail.com>
      Cc: Alex Elsayed <eternaleye+usenet@gmail.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1d2a2cd9
    • N
      tcm_vhost: Change vhost_scsi_target->vhost_wwpn to char * · 5b7517f8
      Nicholas Bellinger 提交于
      This patch changes the vhost_scsi_target->vhost_wwpn[] type used
      by VHOST_SCSI_* ioctls to 'char *' as requested by Blue Swirl in
      order to match the latest QEMU vhost-scsi RFC-v3 userspace code.
      
      Queuing this up into target-pending/master for a -rc3 PULL.
      Reported-by: NBlue Swirl <blauwirbel@gmail.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5b7517f8
    • Y
      target: fix NULL pointer dereference bug alloc_page() fails to get memory · d0e27c88
      Yi Zou 提交于
      I am hitting this bug when the target is low in memory that fails the
      alloc_page() for the newly submitted command. This is a sort of off-by-one
      bug causing NULL pointer dereference in __free_page() since 'i' here is
      really the counter of total pages that have been successfully allocated here.
      Signed-off-by: NYi Zou <yi.zou@intel.com>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: Open-FCoE.org <devel@open-fcoe.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d0e27c88
    • M
      tcm_fc: Avoid debug overhead when not debugging · 1fa8f450
      Mark Rustad 提交于
      Stop doing a pile of work related to debugging messages when
      the ft_debug_logging flag is not set. Use unlikely to add the
      check in a way that the check can be inlined without inlining the
      whole thing.
      Signed-off-by: NMark Rustad <mark.d.rustad@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      1fa8f450
    • N
      tcm_vhost: Post-merge review changes requested by MST · 101998f6
      Nicholas Bellinger 提交于
      This patch contains the post RFC-v5 (post-merge) changes, this includes:
      
      - Add locking comment
      - Move vhost_scsi_complete_cmd ahead of TFO callbacks in order to
        drop forward declarations
      - Drop extra '!= NULL' usage in vhost_scsi_complete_cmd_work()
      - Change vhost_scsi_*_handle_kick() to use pr_debug
      - Fix possible race in vhost_scsi_set_endpoint() for vs->vs_tpg checking
        + assignment.
      - Convert tv_tpg->tpg_vhost_count + ->tv_tpg_port_count from atomic_t ->
        int, and make sure reference is protected by ->tv_tpg_mutex.
      - Drop unnecessary vhost_scsi->vhost_ref_cnt
      - Add 'err:' label for exception path in vhost_scsi_clear_endpoint()
      - Add enum for VQ numbers, add usage in vhost_scsi_open()
      - Add vhost_scsi_flush() + vhost_scsi_flush_vq() following
        drivers/vhost/net.c
      - Add smp_wmb() + vhost_scsi_flush() call during vhost_scsi_set_features()
      - Drop unnecessary copy_from_user() usage with GET_ABI_VERSION ioctl
      - Add missing vhost_scsi_compat_ioctl() caller for vhost_scsi_fops
      - Fix function parameter definition first line to follow existing
        vhost code style
      - Change 'vHost' usage -> 'vhost' in handful of locations
      - Change -EPERM -> -EBUSY usage for two failures in tcm_vhost_drop_nexus()
      - Add comment for tcm_vhost_workqueue in tcm_vhost_init()
      - Make GET_ABI_VERSION return 'int' + add comment in tcm_vhost.h
      Reported-by: NMichael S. Tsirkin <mst@redhat.com>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Cc: Zhi Yong Wu <wuzhy@cn.ibm.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      101998f6
    • F
      tcm_vhost: Fix incorrect IS_ERR() usage in vhost_scsi_map_iov_to_sgl · f0e0e9bb
      Fengguang Wu 提交于
      Fix up a new coccinelle warnings reported by Fengguang Wu + Intel
      0-DAY kernel build testing backend:
      
      drivers/vhost/tcm_vhost.c:537:23-29: ERROR: allocation function on line
      533 returns NULL not ERR_PTR on failure
      
      vim +537 drivers/vhost/tcm_vhost.c
         534          if (!sg)
         535                  return -ENOMEM;
         536          pr_debug("%s sg %p sgl_count %u is_err %ld\n", __func__,
       > 537                 sg, sgl_count, IS_ERR(sg));
         538          sg_init_table(sg, sgl_count);
         539
         540          tv_cmd->tvc_sgl = sg;
      Signed-off-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f0e0e9bb
  8. 14 8月, 2012 9 次提交
  9. 13 8月, 2012 17 次提交