1. 16 Apr, 2015 8 commits
  2. 14 Apr, 2015 5 commits
    • Akinobu Mita's avatar
      target/rd: Don't pass incomplete scatterlist entries to sbc_dif_verify_* · bfd9a53e
      Akinobu Mita authored
      The scatterlist for protection information which is passed to
      sbc_dif_verify_read() or sbc_dif_verify_write() requires that
      neighboring scatterlist entries are contiguous or chained so that they
      can be iterated by sg_next().
      
      However, the protection information for RD-MCP backends could be located
      in the multiple scatterlist arrays when the ramdisk space is too large.
      So if the read/write request straddles this boundary, sbc_dif_verify_read()
      or sbc_dif_verify_write() can't iterate all scatterlist entries.
      
      This problem can be fixed by chaining protection information scatterlist
      at creation time.  For the architectures which don't support sg chaining
      (i.e. !CONFIG_ARCH_HAS_SG_CHAIN), fix it by allocating temporary
      scatterlist if needed.
      Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
      Cc: Nicholas Bellinger <nab@linux-iscsi.org>
      Cc: Sagi Grimberg <sagig@dev.mellanox.co.il>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
      Cc: target-devel@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      bfd9a53e
    • Bart Van Assche's avatar
      target: Remove the unused flag SCF_ACK_KREF · 054922bb
      Bart Van Assche authored
      The flag SCF_ACK_KREF is only set but never tested. Hence remove
      this flag.
      Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      054922bb
    • Bart Van Assche's avatar
      target: Fix two sparse warnings · cb0df4d3
      Bart Van Assche authored
      Avoid that sparse complains about context imbalances.
      Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      cb0df4d3
    • Nicholas Bellinger's avatar
      target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling · c8e63985
      Nicholas Bellinger authored
      This patch fixes a bug for COMPARE_AND_WRITE handling with
      fabrics using SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC.
      
      It adds the missing allocation for cmd->t_bidi_data_sg within
      transport_generic_new_cmd() that is used by COMPARE_AND_WRITE
      for the initial READ payload, even if the fabric is already
      providing a pre-allocated buffer for cmd->t_data_sg.
      
      Also, fix zero-length COMPARE_AND_WRITE handling within the
      compare_and_write_callback() and target_complete_ok_work()
      to queue the response, skipping the initial READ.
      
      This fixes COMPARE_AND_WRITE emulation with loopback, vhost,
      and xen-backend fabric drivers using SG_TO_MEM_NOALLOC.
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: <stable@vger.kernel.org> # v3.12+
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      c8e63985
    • Christoph Hellwig's avatar
      target: simplify the target template registration API · 9ac8928e
      Christoph Hellwig authored
      Instead of calling target_fabric_configfs_init() +
      target_fabric_configfs_register() / target_fabric_configfs_deregister()
      target_fabric_configfs_free() from every target driver, rewrite the API
      so that we have simple register/unregister functions that operate on
      a const operations vector.
      
      This patch also fixes a memory leak in several target drivers. Several
      target drivers namely called target_fabric_configfs_deregister()
      without calling target_fabric_configfs_free().
      
      A large part of this patch is based on earlier changes from
      Bart Van Assche <bart.vanassche@sandisk.com>.
      
      (v2: Add a new TF_CIT_SETUP_DRV macro so that the core configfs code
      can declare attributes as either core only or for drivers)
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      9ac8928e
  3. 08 Apr, 2015 27 commits