1. 10 1月, 2015 2 次提交
    • N
      target: Drop left-over fabric_max_sectors attribute · 7216dc07
      Nicholas Bellinger 提交于
      Now that fabric_max_sectors is no longer used to enforce the maximum
      I/O size, go ahead and drop it's left-over usage in target-core and
      associated backend drivers.
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Roland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      7216dc07
    • 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
  2. 02 12月, 2014 2 次提交
    • N
      target/iblock: Convert to external iblock_backend_dev_attrs · 5645cba0
      Nicholas Bellinger 提交于
      This patch converts IBLOCK to use an external set of device attributes,
      and utilizes target_core_backend_configfs.h macros to generate a default
      set of configfs extended-attr handlers.
      
      It calls target_core_setup_sub_cits() to setup the initial config_item_type
      based on existing target_core_configfs.c defaults, and using configfs_attribute
      generated by DEF_TB_DEFAULT_ATTRIBS(iblock) populates iblock_backend_dev_attrs[]
      
      It introduces no functional change for existing IBLOCK device attributes.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      5645cba0
    • N
      target: Add EXPORT_SYMBOL for existing se_dev_set_* · d30cd123
      Nicholas Bellinger 提交于
      Now that target_core_backend_configfs.h macros will be using these
      se_dev_set attribute functions externally to allow backend drivers
      to populate different attributes, go ahead and add EXPORT_SYMBOL()
      for the existing default set of 30 device attributes.
      
      Also update target_core_backend.h with proper function prototypes.
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d30cd123
  3. 18 4月, 2014 1 次提交
  4. 07 4月, 2014 1 次提交
    • N
      target/iblock: Fix double bioset_integrity_free bug · d84287bc
      Nicholas Bellinger 提交于
      This patch fixes a double free bug during IBLOCK backend shutdown
      where bioset_integrity_free() was incorrectly called ahead of
      bioset_free(), who is already making the same call directly.
      
      This bug was introduced with commit ecebbf6c, and will end up
      triggering a general protection fault in iblock_free_device()
      Reviewed-by: NSagi Grimberg <sagig@mellanox.com>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Cc: Or Gerlitz <ogerlitz@mellanox.com>
      Cc: Quinn Tran <quinn.tran@qlogic.com>
      Cc: Giridhar Malavali <giridhar.malavali@qlogic.com>
      Cc: <stable@vger.kernel.org> #3.14+
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d84287bc
  5. 18 1月, 2014 1 次提交
    • N
      target/iblock: Add blk_integrity + BIP passthrough support · ecebbf6c
      Nicholas Bellinger 提交于
      This patch adds blk_integrity passthrough support for block_device
      backends using IBLOCK.
      
      This includes iblock_alloc_bip() + setup of bio_integrity_payload
      information that attaches to the leading struct bio once bio_list
      is populated during fast-path iblock_execute_rw() I/O dispatch.
      
      It also updates setup in iblock_configure_device() to detect modes
      of protection + se dev->dev_attrib.pi_prot_type accordingly, along
      with creating required bio_set integrity mempools.
      
      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>
      ecebbf6c
  6. 10 1月, 2014 1 次提交
  7. 24 11月, 2013 1 次提交
    • K
      block: Abstract out bvec iterator · 4f024f37
      Kent Overstreet 提交于
      Immutable biovecs are going to require an explicit iterator. To
      implement immutable bvecs, a later patch is going to add a bi_bvec_done
      member to this struct; for now, this patch effectively just renames
      things.
      Signed-off-by: NKent Overstreet <kmo@daterainc.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: "Ed L. Cashin" <ecashin@coraid.com>
      Cc: Nick Piggin <npiggin@kernel.dk>
      Cc: Lars Ellenberg <drbd-dev@lists.linbit.com>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: Matthew Wilcox <willy@linux.intel.com>
      Cc: Geoff Levand <geoff@infradead.org>
      Cc: Yehuda Sadeh <yehuda@inktank.com>
      Cc: Sage Weil <sage@inktank.com>
      Cc: Alex Elder <elder@inktank.com>
      Cc: ceph-devel@vger.kernel.org
      Cc: Joshua Morris <josh.h.morris@us.ibm.com>
      Cc: Philip Kelleher <pjk1939@linux.vnet.ibm.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Jeremy Fitzhardinge <jeremy@goop.org>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: dm-devel@redhat.com
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: linux390@de.ibm.com
      Cc: Boaz Harrosh <bharrosh@panasas.com>
      Cc: Benny Halevy <bhalevy@tonian.com>
      Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Chris Mason <chris.mason@fusionio.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: Andreas Dilger <adilger.kernel@dilger.ca>
      Cc: Jaegeuk Kim <jaegeuk.kim@samsung.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Dave Kleikamp <shaggy@kernel.org>
      Cc: Joern Engel <joern@logfs.org>
      Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp>
      Cc: Mark Fasheh <mfasheh@suse.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Ben Myers <bpm@sgi.com>
      Cc: xfs@oss.sgi.com
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Len Brown <len.brown@intel.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Guo Chao <yan@linux.vnet.ibm.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Asai Thambi S P <asamymuthupa@micron.com>
      Cc: Selvan Mani <smani@micron.com>
      Cc: Sam Bradshaw <sbradshaw@micron.com>
      Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: "Roger Pau Monné" <roger.pau@citrix.com>
      Cc: Jan Beulich <jbeulich@suse.com>
      Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
      Cc: Ian Campbell <Ian.Campbell@citrix.com>
      Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Minchan Kim <minchan@kernel.org>
      Cc: Jiang Liu <jiang.liu@huawei.com>
      Cc: Nitin Gupta <ngupta@vflare.org>
      Cc: Jerome Marchand <jmarchand@redhat.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Peng Tao <tao.peng@emc.com>
      Cc: Andy Adamson <andros@netapp.com>
      Cc: fanchaoting <fanchaoting@cn.fujitsu.com>
      Cc: Jie Liu <jeff.liu@oracle.com>
      Cc: Sunil Mushran <sunil.mushran@gmail.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Pankaj Kumar <pankaj.km@samsung.com>
      Cc: Dan Magenheimer <dan.magenheimer@oracle.com>
      Cc: Mel Gorman <mgorman@suse.de>6
      4f024f37
  8. 13 11月, 2013 1 次提交
  9. 11 9月, 2013 1 次提交
  10. 10 9月, 2013 1 次提交
    • N
      target: Allow sbc_ops->execute_rw() to accept SGLs + data_direction · a82a9538
      Nicholas Bellinger 提交于
      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: NNicholas Bellinger <nab@daterainc.com>
      a82a9538
  11. 13 8月, 2013 1 次提交
  12. 15 5月, 2013 1 次提交
  13. 25 4月, 2013 2 次提交
  14. 28 2月, 2013 1 次提交
  15. 24 2月, 2013 1 次提交
  16. 14 2月, 2013 2 次提交
    • R
      target: Fix error checking for UNMAP commands · bb992e72
      Roland Dreier 提交于
      SBC-3 (revision 35) says:
      
          The PARAMETER LIST LENGTH field specifies the length in bytes of the
          UNMAP parameter list that is available to be transferred from the
          Data-Out Buffer. If the parameter list length is greater than zero
          and less than 0008h (i.e., eight), then the device server shall
          terminate the command with CHECK CONDITION status with the sense key
          set to ILLEGAL REQUEST and the additional sense code set to
          PARAMETER LIST LENGTH ERROR. A PARAMETER LIST LENGTH set to zero
          specifies that no data shall be sent.
      
      so our sense code for too-short descriptors was wrong, and we were
      incorrectly failing commands that didn't transfer any descriptors.
      
      While we're at it, also handle the UNMAP check:
      
          If the ANCHOR bit is set to one, and the ANC_SUP bit in the Logical
          Block Provisioning VPD page (see 6.6.4) is set to zero, then the
          device server shall terminate the command with CHECK CONDITION
          status with the sense key set to ILLEGAL REQUEST and the additional
          sense code set to INVALID FIELD IN CDB.
      
      (chris boot: Fix wrong cut+paste comment in transport_send_check_condition_and_sense)
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bb992e72
    • N
      target/iblock: Use backend REQ_FLUSH hint for WriteCacheEnabled status · d0c8b259
      Nicholas Bellinger 提交于
      This patch allows IBLOCK to check block hints in request_queue->flush_flags
      when reporting current backend device WriteCacheEnabled status to a remote
      SCSI initiator port.
      
      This is done via a se_subsystem_api->get_write_cache() call instead of a
      backend se_device creation time flag, as we expect REQ_FLUSH bits to possibly
      change from an underlying blk_queue_flush() by the SCSI disk driver, or
      internal raw struct block_device driver usage.
      
      Also go ahead and update iblock_execute_rw() bio I/O path code to use
      REQ_FLUSH + REQ_FUA hints when determining WRITE_FUA usage, and make SPC
      emulation code use a spc_check_dev_wce() helper to handle both types of
      cases for virtual backend subsystem drivers.
      
      (asias: Drop unnecessary comparsion operators)
      Reported-by: Nmajianpeng <majianpeng@gmail.com>
      Cc: majianpeng <majianpeng@gmail.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: James Bottomley <JBottomley@Parallels.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d0c8b259
  17. 28 11月, 2012 3 次提交
  18. 16 11月, 2012 1 次提交
    • N
      target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support · f6970ad3
      Nicholas Bellinger 提交于
      This patch adds support for emulation of WRITE_SAME w/ UNMAP=0 within
      iblock_execute_write_same() backend code.
      
      The emulation uses a bio_add_page() call for each sector, and by default
      enforces a limit of max_write_same_len=0xFFFF (65536) sectors following
      what scsi_debug reports per default for MAXIMUM WRITE SAME LENGTH.
      
      It also sets max_write_same_len to the operational default at setup ->
      iblock_configure_device() time.
      
      (hch: Move unmap logic into iblock_execute_write_same_unmap + add
            check for single sector SGLs in iblock_execute_write_same)
      (mkp: Update comment for 0xFFFF magic constant)
      (nab: drop left-over max_write_same_len check in iblock_execute_write_same)
      
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Martin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      f6970ad3
  19. 07 11月, 2012 5 次提交
  20. 18 9月, 2012 3 次提交
  21. 09 9月, 2012 1 次提交
  22. 08 9月, 2012 1 次提交
  23. 17 7月, 2012 6 次提交