1. 08 4月, 2015 4 次提交
  2. 14 2月, 2015 7 次提交
  3. 10 1月, 2015 1 次提交
    • N
      target: Drop arbitrary maximum I/O size limit · 046ba642
      Nicholas Bellinger 提交于
      This patch drops the arbitrary maximum I/O size limit in sbc_parse_cdb(),
      which currently for fabric_max_sectors is hardcoded to 8192 (4 MB for 512
      byte sector devices), and for hw_max_sectors is a backend driver dependent
      value.
      
      This limit is problematic because Linux initiators have only recently
      started to honor block limits MAXIMUM TRANSFER LENGTH, and other non-Linux
      based initiators (eg: MSFT Fibre Channel) can also generate I/Os larger
      than 4 MB in size.
      
      Currently when this happens, the following message will appear on the
      target resulting in I/Os being returned with non recoverable status:
      
        SCSI OP 28h with too big sectors 16384 exceeds fabric_max_sectors: 8192
      
      Instead, drop both [fabric,hw]_max_sector checks in sbc_parse_cdb(),
      and convert the existing hw_max_sectors into a purely informational
      attribute used to represent the granuality that backend driver and/or
      subsystem code is splitting I/Os upon.
      
      Also, update FILEIO with an explicit FD_MAX_BYTES check in fd_execute_rw()
      to deal with the one special iovec limitiation case.
      
      v2 changes:
        - Drop hw_max_sectors check in sbc_parse_cdb()
      Reported-by: NLance Gropper <lance.gropper@qosserver.com>
      Reported-by: NStefan Priebe <s.priebe@profihost.ag>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Cc: stable@vger.kernel.org # 3.4
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      046ba642
  4. 04 12月, 2014 1 次提交
  5. 25 11月, 2014 1 次提交
  6. 03 10月, 2014 1 次提交
  7. 12 6月, 2014 4 次提交
  8. 07 4月, 2014 7 次提交
  9. 14 3月, 2014 1 次提交
  10. 07 3月, 2014 1 次提交
    • S
      Target/sbc: Fix sbc_copy_prot for offset scatters · 16c0ae02
      Sagi Grimberg 提交于
      When copying between device and command protection scatters
      we must take into account that device scatters might be offset
      and we might copy outside scatter range. Thus for each cmd prot
      scatter we must take the min between cmd prot scatter, dev prot
      scatter, and whats left (and loop in case we havn't copied enough
      from/to cmd prot scatter).
      
      Example (single t_prot_sg of len 2048):
      kernel: sbc_dif_copy_prot: se_cmd=ffff880380aaf970, left=2048, len=2048, dev_prot_sg_offset=3072, dev_prot_sg_len=4096
      kernel: isert: se_cmd=ffff880380aaf970 PI error found type 0 at sector 0x2600 expected 0x0 vs actual 0x725f, lba=2580
      
      Instead of copying 2048 from offset 3072 (copying junk outside sg
      limit 4096), we must to copy 1024 and continue to next sg until
      we complete cmd prot scatter.
      
      This issue was found using iSER T10-PI offload over rd_mcp (wasn't
      discovered with fileio since file_dev prot sglists are never offset).
      
      Changes from v1:
      - Fix sbc_copy_prot copy length miss-calculation
      
      Changes from v0:
      - Removed psg->offset consideration for psg_len computation
      - Removed sg->offset consideration for offset condition
      - Added copied consideraiton for len computation
      - Added copied offset to paddr when doing memcpy
      Signed-off-by: NSagi Grimberg <sagig@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      16c0ae02
  11. 24 2月, 2014 2 次提交
  12. 13 2月, 2014 1 次提交
  13. 25 1月, 2014 1 次提交
  14. 18 1月, 2014 3 次提交
    • N
      target/sbc: Add P_TYPE + PROT_EN bits to READ_CAPACITY_16 · 56dac14c
      Nicholas Bellinger 提交于
      This patch updates sbc_emulate_readcapacity_16() to set
      P_TYPE and PROT_EN bits when DIF emulation is enabled by
      the backend device.
      Reviewed-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      56dac14c
    • N
      target/sbc: Add DIF TYPE1+TYPE3 read/write verify emulation · 41861fa8
      Nicholas Bellinger 提交于
      This patch adds support for DIF read/write verify emulation
      for TARGET_DIF_TYPE1_PROT + TARGET_DIF_TYPE3_PROT operation.
      
      This includes sbc_dif_verify_write() + sbc_dif_verify_read()
      calls accessable by backend drivers to perform DIF verify
      for SGL based data and protection information.
      
      Also included is sbc_dif_copy_prot() logic to copy protection
      information to/from backend provided protection SGLs.
      
      Based on scsi_debug.c DIF TYPE1+TYPE3 emulation.
      
      v2 changes:
        - Select CRC_T10DIF for TARGET_CORE in Kconfig (Fengguang)
        - Drop IP checksum logic from sbc_dif_v1_verify (MKP)
        - Fix offset on app_tag = 0xffff in sbc_dif_verify_read()
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      41861fa8
    • N
      target/sbc: Add DIF setup in sbc_check_prot + sbc_parse_cdb · 499bf77b
      Nicholas Bellinger 提交于
      This patch adds sbc_check_prot() for performing various DIF
      related CDB sanity checks, along with setting cmd->prot_type
      once sanity checks have passed.
      
      Also, add calls in sbc_parse_cdb() for READ_[10,12,16] +
      WRITE_[10,12,16] to perform DIF sanity checking.
      
      v2 changes:
        - Make sbc_check_prot defined as static (Fengguang + Wei)
        - Remove unprotected READ/WRITE warning (mkp)
        - Populate cmd->prot_type + friends (Sagi)
        - Drop SCF_PROT usage
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      499bf77b
  15. 10 1月, 2014 1 次提交
  16. 13 11月, 2013 1 次提交
  17. 17 10月, 2013 1 次提交
  18. 03 10月, 2013 2 次提交
    • N
      target: Fail on non zero scsi_status in compare_and_write_callback · db60df88
      Nicholas Bellinger 提交于
      This patch addresses a bug for backends such as IBLOCK that perform
      asynchronous completion via transport_complete_cmd(), that will call
      target_complete_failure_work() -> transport_generic_request_failure(),
      upon exception status and invoke cmd->transport_complete_callback()
      -> compare_and_write_callback() incorrectly during the failure case.
      
      It adds a check for a non zero se_cmd->scsi_status within the first
      invocation of compare_and_write_callback(), and will jump to out plus
      up se_device->caw_sem before exiting the callback.
      Reported-by: NThomas Glanzmann <thomas@glanzmann.de>
      Tested-by: NThomas Glanzmann <thomas@glanzmann.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      db60df88
    • N
      target: Fix recursive COMPARE_AND_WRITE callback failure · d8855c15
      Nicholas Bellinger 提交于
      This patch addresses a bug when compare_and_write_callback() invoked from
      target_complete_ok_work() hits an failure from __target_execute_cmd() ->
      cmd->execute_cmd(), that ends up calling transport_generic_request_failure()
      -> compare_and_write_post(), thus causing SCF_COMPARE_AND_WRITE_POST to
      incorrectly be set.
      
      The result of this bug is that target_complete_ok_work() no longer hits
      the if (!rc && !(cmd->se_cmd_flags & SCF_COMPARE_AND_WRITE_POST) check
      that forces an immediate return, and instead double completes the se_cmd
      in question, triggering an OOPs in the process.
      
      This patch changes compare_and_write_post() to only set this bit when a
      failure has not already occured to ensure the immediate return from within
      target_complete_ok_work(), and thus allow transport_generic_request_failure()
      to handle the sending of the CHECK_CONDITION exception status.
      Reported-by: NThomas Glanzmann <thomas@glanzmann.de>
      Tested-by: NThomas Glanzmann <thomas@glanzmann.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d8855c15