<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/target/target_core_sbc.c, branch linux-4.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-05-06T20:03:53Z</updated>
<entry>
<title>target: Fix COMPARE_AND_WRITE with SG_TO_MEM_NOALLOC handling</title>
<updated>2015-05-06T20:03:53Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-04-07T21:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca7767a3f859d6e5487ddcf7a23515e19188b922'/>
<id>urn:sha1:ca7767a3f859d6e5487ddcf7a23515e19188b922</id>
<content type='text'>
commit c8e639852ad720499912acedfd6b072325fd2807 upstream.

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-&gt;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-&gt;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: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>target: do not reject FUA CDBs when write cache is enabled but emulate_write_cache is 0</title>
<updated>2015-03-20T06:26:46Z</updated>
<author>
<name>Christophe Vu-Brugier</name>
</author>
<published>2015-03-19T13:30:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9bc6548f372d8c829235095d91de99d8df79db6e'/>
<id>urn:sha1:9bc6548f372d8c829235095d91de99d8df79db6e</id>
<content type='text'>
A check that rejects a CDB with FUA bit set if no write cache is
emulated was added by the following commit:

  fde9f50 target: Add sanity checks for DPO/FUA bit usage

The condition is as follows:

  if (!dev-&gt;dev_attrib.emulate_fua_write ||
      !dev-&gt;dev_attrib.emulate_write_cache)

However, this check is wrong if the backend device supports WCE but
"emulate_write_cache" is disabled.

This patch uses se_dev_check_wce() (previously named
spc_check_dev_wce) to invoke transport-&gt;get_write_cache() if the
device has a write cache or check the "emulate_write_cache" attribute
otherwise.

Reported-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Christophe Vu-Brugier &lt;cvubrugier@fastmail.fm&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending</title>
<updated>2015-02-21T21:21:19Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2015-02-21T21:21:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e20d3ef5406d3a28b76a63905b2a6bd3fb95c377'/>
<id>urn:sha1:e20d3ef5406d3a28b76a63905b2a6bd3fb95c377</id>
<content type='text'>
Pull SCSI target updates from Nicholas Bellinger:
 "The highlights this round include:

   - Update vhost-scsi to support F_ANY_LAYOUT using mm/iov_iter.c
     logic, and signal VERSION_1 support (MST + Viro + nab)

   - Fix iscsi/iser-target to remove problematic active_ts_set usage
     (Gavin Guo)

   - Update iscsi/iser-target to support multi-sequence sendtargets
     (Sagi)

   - Fix original PR_APTPL_BUF_LEN 8k size limitation (Martin Svec)

   - Add missing WRITE_SAME end-of-device sanity check (Bart)

   - Check for LBA + sectors wrap-around in sbc_parse_cdb() (nab)

   - Other various minor SPC/SBC compliance fixes based upon Ronnie
     Sahlberg test suite (nab)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (32 commits)
  target: Set LBPWS10 bit in Logical Block Provisioning EVPD
  target: Fail UNMAP when emulate_tpu=0
  target: Fail WRITE_SAME w/ UNMAP=1 when emulate_tpws=0
  target: Add sanity checks for DPO/FUA bit usage
  target: Perform PROTECT sanity checks for WRITE_SAME
  target: Fail I/O with PROTECT bit when protection is unsupported
  target: Check for LBA + sectors wrap-around in sbc_parse_cdb
  target: Add missing WRITE_SAME end-of-device sanity check
  iscsi-target: Avoid IN_LOGOUT failure case for iser-target
  target: Fix PR_APTPL_BUF_LEN buffer size limitation
  iscsi-target: Drop problematic active_ts_list usage
  iscsi/iser-target: Support multi-sequence sendtargets text response
  iser-target: Remove duplicate function names
  vhost/scsi: potential memory corruption
  vhost/scsi: Global tcm_vhost -&gt; vhost_scsi rename
  vhost/scsi: Drop left-over scsi_tcq.h include
  vhost/scsi: Set VIRTIO_F_ANY_LAYOUT + VIRTIO_F_VERSION_1 feature bits
  vhost/scsi: Add ANY_LAYOUT support in vhost_scsi_handle_vq
  vhost/scsi: Add ANY_LAYOUT iov -&gt; sgl mapping prerequisites
  vhost/scsi: Change vhost_scsi_map_to_sgl to accept iov ptr + len
  ...
</content>
</entry>
<entry>
<title>target: Fail UNMAP when emulate_tpu=0</title>
<updated>2015-02-14T02:54:48Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-14T02:29:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=61fdb4acc8411bf50589bc67431ad12e21e7678a'/>
<id>urn:sha1:61fdb4acc8411bf50589bc67431ad12e21e7678a</id>
<content type='text'>
This patch adds a check within sbc_parse_cdb() to fail a UNMAP op,
if the backend device has emulate_tpu disabled.

Cc: Martin Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Fail WRITE_SAME w/ UNMAP=1 when emulate_tpws=0</title>
<updated>2015-02-14T02:54:40Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-14T01:56:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0a91295557666f9e58b79b5177a98229007803b'/>
<id>urn:sha1:d0a91295557666f9e58b79b5177a98229007803b</id>
<content type='text'>
This patch adds a check within sbc_setup_write_same() to fail a
WRITE_SAME w/ UNMAP=1 op, if the backend device has emulate_tpws
disabled.

Cc: Martin Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Add sanity checks for DPO/FUA bit usage</title>
<updated>2015-02-14T02:09:46Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-13T23:28:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fde9f50f80fe89a9115b4bfa773017272597d85d'/>
<id>urn:sha1:fde9f50f80fe89a9115b4bfa773017272597d85d</id>
<content type='text'>
This patch adds a sbc_check_dpofua() function that performs sanity
checks for DPO/FUA command bits.

It introduces checks to fail when either bit is set, but the backend
device is not advertising support for them.

It also moves the existing cmd-&gt;se_cmd_flags |= SCF_FUA assignement
into the new helper function.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Perform PROTECT sanity checks for WRITE_SAME</title>
<updated>2015-02-14T02:09:45Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-14T01:32:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=afd73f1b60fc5883ea4982f68e9522e77b28f1e5'/>
<id>urn:sha1:afd73f1b60fc5883ea4982f68e9522e77b28f1e5</id>
<content type='text'>
This patch adds a call to sbc_check_prot() within sbc_setup_write_same()
code to perform the various protection releated sanity checks, including
failing if WRPROTECT or RDPROTECT is set for a backend device that has
not advertised support for T10-PI.

Also, since WRITE_SAME + T10-PI is currently not supported by IBLOCK +
FILEIO backends, go ahead and fail if -&gt;execute_write_same() is invoked
with a non zero cmd-&gt;prot_op.

Cc: Martin Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Fail I/O with PROTECT bit when protection is unsupported</title>
<updated>2015-02-14T02:09:44Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-13T22:49:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f7b7c06f386c5e990acb87a8bc96137b9f978977'/>
<id>urn:sha1:f7b7c06f386c5e990acb87a8bc96137b9f978977</id>
<content type='text'>
This patch adds an explicit check for WRPROTECT + RDPROTECT bit usage
within sbc_check_prot(), and fails with TCM_INVALID_CDB_FIELD if the
backend device does not have protection enabled.

Also, update sbc_check_prot() to return sense_reason_t in order to
propigate up the correct sense ASQ.

Cc: Martin Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Sagi Grimberg &lt;sagig@mellanox.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Check for LBA + sectors wrap-around in sbc_parse_cdb</title>
<updated>2015-02-14T02:09:44Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-13T22:27:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=aa179935edea9a64dec4b757090c8106a3907ffa'/>
<id>urn:sha1:aa179935edea9a64dec4b757090c8106a3907ffa</id>
<content type='text'>
This patch adds a check to sbc_parse_cdb() in order to detect when
an LBA + sector vs. end-of-device calculation wraps when the LBA is
sufficently large enough (eg: 0xFFFFFFFFFFFFFFFF).

Cc: Martin Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Add missing WRITE_SAME end-of-device sanity check</title>
<updated>2015-02-14T02:09:35Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2015-02-13T22:09:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8e575c50a171f2579e367a7f778f86477dfdaf49'/>
<id>urn:sha1:8e575c50a171f2579e367a7f778f86477dfdaf49</id>
<content type='text'>
This patch adds a check to sbc_setup_write_same() to verify
the incoming WRITE_SAME LBA + number of blocks does not exceed
past the end-of-device.

Also check for potential LBA wrap-around as well.

Reported-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Cc: Martin Petersen &lt;martin.petersen@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: stable@vger.kernel.org # 3.8+
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
