An error occurred fetching the project authors.
  1. 17 May, 2015 1 commit
    • Akinobu Mita's avatar
      target/file: Fix BUG() when CONFIG_DEBUG_SG=y and DIF protection enabled · cc75f251
      Akinobu Mita authored
      [ Upstream commit 38da0f49 ]
      
      When CONFIG_DEBUG_SG=y and DIF protection support enabled, kernel
      BUG()s are triggered due to the following two issues:
      
      1) prot_sg is not initialized by sg_init_table().
      
      When CONFIG_DEBUG_SG=y, scatterlist helpers check sg entry has a
      correct magic value.
      
      2) vmalloc'ed buffer is passed to sg_set_buf().
      
      sg_set_buf() uses virt_to_page() to convert virtual address to struct
      page, but it doesn't work with vmalloc address.  vmalloc_to_page()
      should be used instead.  As prot_buf isn't usually too large, so
      fix it by allocating prot_buf by kmalloc instead of vmalloc.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Sagi Grimberg <sagig@mellanox.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: <stable@vger.kernel.org> # v3.14+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarSasha Levin <sasha.levin@oracle.com>
      cc75f251
  2. 27 Jan, 2015 1 commit
    • Nicholas Bellinger's avatar
      target: Drop arbitrary maximum I/O size limit · 82bc9d04
      Nicholas Bellinger authored
      commit 046ba642 upstream.
      
      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: default avatarLance Gropper <lance.gropper@qosserver.com>
      Reported-by: default avatarStefan 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>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      82bc9d04
  3. 08 Oct, 2014 1 commit
  4. 17 Sep, 2014 1 commit
  5. 07 Apr, 2014 1 commit
  6. 19 Jan, 2014 2 commits
    • Nicholas Bellinger's avatar
      target/file: Add DIF protection support to fd_execute_rw · 42201b55
      Nicholas Bellinger authored
      This patch adds support for DIF protection into fd_execute_rw() code
      for WRITE/READ I/O using sbc_dif_verify_[write,read]() logic.
      
      It adds fd_do_prot_rw() for handling interface with FILEIO PI, and
      uses a locally allocated fd_prot->prot_buf + fd_prot->prot_sg for
      interacting with SBC DIF verify emulation code.
      
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      42201b55
    • Nicholas Bellinger's avatar
      target/file: Add DIF protection init/format support · 0f5e2ec4
      Nicholas Bellinger authored
      This patch adds support for DIF protection init/format support into
      the FILEIO backend.
      
      It involves using a seperate $FILE.protection for storing PI that is
      opened via fd_init_prot() using the common pi_prot_type attribute.
      The actual formatting of the protection is done via fd_format_prot()
      using the common pi_prot_format attribute, that will populate the
      initial PI data based upon the currently configured pi_prot_type.
      
      Based on original FILEIO code from Sagi.
      
      v1 changes:
        - Fix sparse warnings in fd_init_format_buf (Fengguang)
      
      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: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      0f5e2ec4
  7. 19 Dec, 2013 1 commit
    • Nicholas Bellinger's avatar
      target/file: Update hw_max_sectors based on current block_size · 95cadace
      Nicholas Bellinger authored
      This patch allows FILEIO to update hw_max_sectors based on the current
      max_bytes_per_io.  This is required because vfs_[writev,readv]() can accept
      a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really
      needs to be calculated based on block_size.
      
      This addresses a >= v3.5 bug where block_size=512 was rejecting > 1M
      sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for
      the block_size=4096 case.
      
      (v2: Use max_bytes_per_io instead of ->update_hw_max_sectors)
      Reported-by: default avatarHenrik Goldman <hg@x-formation.com>
      Cc: <stable@vger.kernel.org> #3.5+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      95cadace
  8. 20 Nov, 2013 1 commit
  9. 11 Sep, 2013 1 commit
  10. 09 Sep, 2013 1 commit
    • Nicholas Bellinger's avatar
      target: Allow sbc_ops->execute_rw() to accept SGLs + data_direction · a82a9538
      Nicholas Bellinger authored
      COMPARE_AND_WRITE expects to be able to send down a DMA_FROM_DEVICE
      to obtain the necessary READ payload for comparision against the
      first half of the WRITE payload containing the verify user data.
      
      Currently virtual backends expect to internally reference SGLs,
      SGL nents, and data_direction, so change IBLOCK, FILEIO and RD
      sbc_ops->execute_rw() to accept this values as function parameters.
      
      Also add default sbc_execute_rw() handler for the typical case for
      cmd->execute_rw() submission using cmd->t_data_sg, cmd->t_data_nents,
      and cmd->data_direction).
      
      v2 Changes:
        - Add SCF_COMPARE_AND_WRITE command flag
        - Use sbc_execute_rw() for normal cmd->execute_rw() submission
          with expected se_cmd members.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Hannes Reinecke <hare@suse.de>
      Cc: Martin Petersen <martin.petersen@oracle.com>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@daterainc.com>
      a82a9538
  11. 13 Aug, 2013 1 commit
  12. 31 May, 2013 1 commit
  13. 03 May, 2013 1 commit
  14. 25 Apr, 2013 5 commits
  15. 28 Feb, 2013 1 commit
  16. 23 Feb, 2013 2 commits
  17. 20 Feb, 2013 1 commit
    • Nicholas Bellinger's avatar
      target/file: Add WRITE_SAME w/ UNMAP=0 emulation support · 7b745c84
      Nicholas Bellinger authored
      This patch adds support for emulation of WRITE_SAME w/ UNMAP=0 within
      fd_execute_write_same() backend code.
      
      The emulation uses vfs_writev() to submit a locally populated buffer
      from the received WRITE_SAME scatterlist block for duplication, and by
      default enforces a limit of max_write_same_len=0x1000 (8192) sectors up
      to the limit of 1024 iovec entries for the single call to vfs_writev().
      
      It also sets max_write_same_len to the operational default at setup ->
      fd_configure_device() time.
      
      Tested with 512, 1k, 2k, and 4k block_sizes.
      
      (asias: convert to vzalloc)
      
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Asias He <asias@redhat.com>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      7b745c84
  18. 05 Dec, 2012 2 commits
  19. 28 Nov, 2012 1 commit
  20. 07 Nov, 2012 5 commits
  21. 02 Oct, 2012 1 commit
    • Nicholas Bellinger's avatar
      target/file: Re-enable optional fd_buffered_io=1 operation · b32f4c7e
      Nicholas Bellinger authored
      This patch re-adds the ability to optionally run in buffered FILEIO mode
      (eg: w/o O_DSYNC) for device backends in order to once again use the
      Linux buffered cache as a write-back storage mechanism.
      
      This logic was originally dropped with mainline v3.5-rc commit:
      
      commit a4dff304
      Author: Nicholas Bellinger <nab@linux-iscsi.org>
      Date:   Wed May 30 16:25:41 2012 -0700
      
          target/file: Use O_DSYNC by default for FILEIO backends
      
      This difference with this patch is that fd_create_virtdevice() now
      forces the explicit setting of emulate_write_cache=1 when buffered FILEIO
      operation has been enabled.
      
      (v2: Switch to FDBD_HAS_BUFFERED_IO_WCE + add more detailed
           comment as requested by hch)
      Reported-by: default avatarFerry <iscsitmp@bananateam.nl>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      b32f4c7e
  22. 18 Sep, 2012 1 commit
  23. 01 Aug, 2012 1 commit
    • Al Viro's avatar
      delousing target_core_file a bit · dbc6e022
      Al Viro authored
      * set_fs(KERNEL_DS) + getname() is probably the weirdest implementation
      of strdup() I've seen.  Especially since they don't to copy it at all...
      * filp_open() never returns NULL; it's ERR_PTR(-E...) on failure.
      * file->f_dentry is never going to be NULL, TYVM.
      * match_strdup() + snprintf() + kfree() is a bloody weird way to spell
      match_strlcpy().
      
      Pox on cargo-cult programmers...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      dbc6e022
  24. 17 Jul, 2012 3 commits
  25. 03 Jun, 2012 1 commit
    • Nicholas Bellinger's avatar
      target/file: Use O_DSYNC by default for FILEIO backends · a4dff304
      Nicholas Bellinger authored
      Convert to use O_DSYNC for all cases at FILEIO backend creation time to
      avoid the extra syncing of pure timestamp updates with legacy O_SYNC during
      default operation as recommended by hch.  Continue to do this independently of
      Write Cache Enable (WCE) bit, as WCE=0 is currently the default for all backend
      devices and enabled by user on per device basis via attrib/emulate_write_cache.
      
      This patch drops the now unnecessary fd_buffered_io= token usage that was
      originally signalling when to explictly disable O_SYNC at backend creation
      time for buffered I/O operation.  This can end up being dangerous for a number
      of reasons during physical node failure, so go ahead and drop this option
      for now when O_DSYNC is used as the default.
      
      Also allow explict FUA WRITEs -> vfs_fsync_range() call to function in
      fd_execute_cmd() independently of WCE bit setting.
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      a4dff304
  26. 17 May, 2012 1 commit
  27. 06 May, 2012 1 commit