<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target, branch v3.0.44</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/target?h=v3.0.44</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/target?h=v3.0.44'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-10-02T16:47:23Z</updated>
<entry>
<title>target: Fix -&gt;data_length re-assignment bug with SCSI overflow</title>
<updated>2012-10-02T16:47:23Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-08-16T22:33:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e3653afefd005d16274c9f16511530de3d511c1a'/>
<id>urn:sha1:e3653afefd005d16274c9f16511530de3d511c1a</id>
<content type='text'>
commit 4c054ba63ad47ef244cfcfa1cea38134620a5bae upstream.

This patch fixes a long-standing bug with SCSI overflow handling
where se_cmd-&gt;data_length was incorrectly being re-assigned to
the larger CDB extracted allocation length, resulting in a number
of fabric level errors that would end up causing a session reset
in most cases.  So instead now:

 - Only re-assign se_cmd-&gt;data_length durining UNDERFLOW (to use the
   smaller value)
 - Use existing se_cmd-&gt;data_length for OVERFLOW (to use the smaller
   value)

This fix has been tested with the following CDB to generate an
SCSI overflow:

  sg_raw -r512 /dev/sdc 28 0 0 0 0 0 0 0 9 0

Tested using iscsi-target, tcm_qla2xxx, loopback and tcm_vhost fabric
ports.  Here is a bit more detail on each case:

 - iscsi-target: Bug with open-iscsi with overflow, sg_raw returns
                 -3584 bytes of data.
 - tcm_qla2xxx: Working as expected, returnins 512 bytes of data
 - loopback: sg_raw returns CHECK_CONDITION, from overflow rejection
             in transport_generic_map_mem_to_cmd()
 - tcm_vhost: Same as loopback

Reported-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Boaz Harrosh &lt;bharrosh@panasas.com&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>tcm_fc: Resolve suspicious RCU usage warnings</title>
<updated>2012-07-16T15:47:49Z</updated>
<author>
<name>Mark Rustad</name>
<email>mark.d.rustad@intel.com</email>
</author>
<published>2012-06-26T22:57:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e69325eb5e413816e25d3b8599f67644f4f49698'/>
<id>urn:sha1:e69325eb5e413816e25d3b8599f67644f4f49698</id>
<content type='text'>
commit 863555be0c81558b1af277addcf68acb8f778860 upstream.

Use rcu_dereference_protected to tell rcu that the ft_lport_lock
is held during ft_lport_create. This resolved "suspicious RCU usage"
warnings when debugging options are turned on.

Signed-off-by: Mark Rustad &lt;mark.d.rustad@intel.com&gt;
Tested-by: Ross Brattain &lt;ross.b.brattain@intel.com&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: Fix 16-bit target ports for SET TARGET PORT GROUPS emulation</title>
<updated>2012-04-02T16:27:12Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-02-24T01:22:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=91e4c264a6f7b2de2fa5d996db9297e99bfb1006'/>
<id>urn:sha1:91e4c264a6f7b2de2fa5d996db9297e99bfb1006</id>
<content type='text'>
commit 33395fb8a13731c7ef7b175dbf5a4d8a6738fe6c upstream.

The old code did (MSB &lt;&lt; 8) &amp; 0xff, which always evaluates to 0.  Just use
get_unaligned_be16() so we don't have to worry about whether our open-coded
version is correct or not.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&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: Don't set WBUS16 or SYNC bits in INQUIRY response</title>
<updated>2012-04-02T16:27:12Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-02-14T00:18:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2a540015f107ec0b073725ab7575bd7990e094d9'/>
<id>urn:sha1:2a540015f107ec0b073725ab7575bd7990e094d9</id>
<content type='text'>
commit effc6cc8828257c32c37635e737f14fd6e19ecd7 upstream.

SPC-4 says about the WBUS16 and SYNC bits:

    The meanings of these fields are specific to SPI-5 (see 6.4.3).
    For SCSI transport protocols other than the SCSI Parallel
    Interface, these fields are reserved.

We don't have a SPI fabric module, so we should never set these bits.
(The comment was misleading, since it only mentioned Sync but the
actual code set WBUS16 too).

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&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>tcm_fc: Fix fc_exch memory leak in ft_send_resp_status</title>
<updated>2012-04-02T16:27:11Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-03-10T07:45:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bf8109a3b01b5c64e0ec4b11fa020abca8d00223'/>
<id>urn:sha1:bf8109a3b01b5c64e0ec4b11fa020abca8d00223</id>
<content type='text'>
commit 031ed4d565b31880a4136bb7366bc89f5b1dba7d upstream.

This patch fixes a bug in tcm_fc where fc_exch memory from fc_exch_mgr-&gt;ep_pool
is currently being leaked by ft_send_resp_status() usage.  Following current
code in ft_queue_status() response path, using lport-&gt;tt.seq_send() needs to be
followed by a lport-&gt;tt.exch_done() in order to release fc_exch memory back into
libfc_em kmem_cache.

ft_send_resp_status() code is currently used in pre submit se_cmd ft_send_work()
error exceptions, TM request setup exceptions, and main TM response callback
path in ft_queue_tm_resp().  This bugfix addresses the leak in these cases.

Cc: Mark D Rustad &lt;mark.d.rustad@intel.com&gt;
Cc: Kiran Patil &lt;kiran.patil@intel.com&gt;
Cc: Robert Love &lt;robert.w.love@intel.com&gt;
Cc: Andy Grover &lt;agrover@redhat.com&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>tcm_loop: Set residual field for SCSI commands</title>
<updated>2012-04-02T16:27:11Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-02-14T23:30:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bbcf567a1c0237990feec5dfe1787dc014215740'/>
<id>urn:sha1:bbcf567a1c0237990feec5dfe1787dc014215740</id>
<content type='text'>
commit 6cf3fa6918baab0c447f1206f1cef9166ad04864 upstream.

If the target core signals an over- or under-run, tcm_loop should call
scsi_set_resid() to tell the SCSI midlayer about the residual data length.

The difference can be seen by doing something like

    strace -eioctl sg_raw -r 1024 /dev/sda 8 0 0 0 1 0 &gt; /dev/null

and looking at the "resid=" part of the SG_IO ioctl -- after this patch,
the field is correctly reported as 512.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&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: Correct sense key for INVALID FIELD IN {PARAMETER LIST,CDB}</title>
<updated>2012-02-13T19:06:11Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-01-10T01:54:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=967a6f42d195569b596f9af39cd878803a0d1f8b'/>
<id>urn:sha1:967a6f42d195569b596f9af39cd878803a0d1f8b</id>
<content type='text'>
commit 9fbc8909876a2160044e71d376848973b9bfdc3f upstream.

According to SPC-4, the sense key for commands that are failed with
INVALID FIELD IN PARAMETER LIST and INVALID FIELD IN CDB should be
ILLEGAL REQUEST (5h) rather than ABORTED COMMAND (Bh).  Without this
patch, a tcm_loop LUN incorrectly gives:

    # sg_raw -r 1 -v /dev/sda 3 1 0 0 ff 0
    Sense Information:
     Fixed format, current;  Sense key: Aborted Command
     Additional sense: Invalid field in cdb
     Raw sense data (in hex):
            70 00 0b 00 00 00 00 0a  00 00 00 00 24 00 00 00
            00 00

While a real SCSI disk gives:

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
     Additional sense: Invalid field in cdb
     Raw sense data (in hex):
            70 00 05 00 00 00 00 18  00 00 00 00 24 00 00 00
            00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00

with the main point being that the real disk gives a sense key of
ILLEGAL REQUEST (5h).

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&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: Allow PERSISTENT RESERVE IN for non-reservation holder</title>
<updated>2012-02-13T19:06:11Z</updated>
<author>
<name>Marco Sanvido</name>
<email>marco@purestorage.com</email>
</author>
<published>2012-01-04T01:12:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b8a8c4aa9e22c2de7af17ea48b7cc868f5bc79ad'/>
<id>urn:sha1:b8a8c4aa9e22c2de7af17ea48b7cc868f5bc79ad</id>
<content type='text'>
commit 6816966a8418b980481b4dced7eddd1796b145e8 upstream.

Initiators that aren't the active reservation holder should be able to
do a PERSISTENT RESERVE IN command in all cases, so add it to the list
of allowed CDBs in core_scsi3_pr_seq_non_holder().

Signed-off-by: Marco Sanvido &lt;marco@purestorage.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&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: Use correct preempted registration sense code</title>
<updated>2012-02-13T19:06:11Z</updated>
<author>
<name>Marco Sanvido</name>
<email>marco@purestorage.com</email>
</author>
<published>2012-01-04T01:12:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b96473a25fa375b08c9bf0c1c0dbf47ca826eaec'/>
<id>urn:sha1:b96473a25fa375b08c9bf0c1c0dbf47ca826eaec</id>
<content type='text'>
commit 9e08e34e3735ae057eb3834da3570995811b7eb9 upstream.

The comments quote the right parts of the spec:

   * d) Establish a unit attention condition for the
   *    initiator port associated with every I_T nexus
   *    that lost its registration other than the I_T
   *    nexus on which the PERSISTENT RESERVE OUT command
   *    was received, with the additional sense code set
   *    to REGISTRATIONS PREEMPTED.

and

   * e) Establish a unit attention condition for the initiator
   *    port associated with every I_T nexus that lost its
   *    persistent reservation and/or registration, with the
   *    additional sense code set to REGISTRATIONS PREEMPTED;

but the actual code accidentally uses ASCQ_2AH_RESERVATIONS_PREEMPTED
instead of ASCQ_2AH_REGISTRATIONS_PREEMPTED.  Fix this.

Signed-off-by: Marco Sanvido &lt;marco@purestorage.com&gt;
Signed-off-by: Roland Dreier &lt;roland@purestorage.com&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: Set additional sense length field in sense data</title>
<updated>2012-01-26T01:25:00Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-12-13T22:55:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=06a23648ebbb532745eb85c1a381b83dd90e94af'/>
<id>urn:sha1:06a23648ebbb532745eb85c1a381b83dd90e94af</id>
<content type='text'>
commit 895f3022523361e9b383cf48f51feb1f7d5e7e53 upstream.

The target code was not setting the additional sense length field in the
sense data it returned, which meant that at least the Linux stack
ignored the ASC/ASCQ fields.  For example, without this patch, on a
tcm_loop device:

    # sg_raw -v /dev/sda 2 0 0 0 0 0

gives

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
      Raw sense data (in hex):
            70 00 05 00 00 00 00 00

while after the patch we correctly get the following (which matches what
a regular disk returns):

        cdb to send: 02 00 00 00 00 00
    SCSI Status: Check Condition

    Sense Information:
     Fixed format, current;  Sense key: Illegal Request
     Additional sense: Invalid command operation code
     Raw sense data (in hex):
            70 00 05 00 00 00 00 0a  00 00 00 00 20 00 00 00
            00 00

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
