<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/target/target_core_cdb.c, branch linux-3.4.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.4.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.4.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2013-09-08T04:58:16Z</updated>
<entry>
<title>target: Fix trailing ASCII space usage in INQUIRY vendor+model</title>
<updated>2013-09-08T04:58:16Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2013-07-24T23:15:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e51c435e8f955faeb93c8a10f71d7ebf43d887db'/>
<id>urn:sha1:e51c435e8f955faeb93c8a10f71d7ebf43d887db</id>
<content type='text'>
commit ee60bddba5a5f23e39598195d944aa0eb2d455e5 upstream.

This patch fixes spc_emulate_inquiry_std() to add trailing ASCII
spaces for INQUIRY vendor + model fields following SPC-4 text:

  "ASCII data fields described as being left-aligned shall have any
   unused bytes at the end of the field (i.e., highest offset) and
   the unused bytes shall be filled with ASCII space characters (20h)."

This addresses a problem with Falconstor NSS multipathing.

Reported-by: Tomas Molota &lt;tomas.molota@lightstorm.sk&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: Check number of unmap descriptors against our limit</title>
<updated>2012-08-15T15:10:32Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-07-16T22:34:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6213566323948ac7ed0aa4eb78058e77d445b0f8'/>
<id>urn:sha1:6213566323948ac7ed0aa4eb78058e77d445b0f8</id>
<content type='text'>
commit 7409a6657aebf8be74c21d0eded80709b27275cb upstream.

Fail UNMAP commands that have more than our reported limit on unmap
descriptors.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>target: Fix possible integer underflow in UNMAP emulation</title>
<updated>2012-08-15T15:10:32Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-07-16T22:34:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c329e96ae86fb69c30287a434426f2083fb2430b'/>
<id>urn:sha1:c329e96ae86fb69c30287a434426f2083fb2430b</id>
<content type='text'>
commit b7fc7f3777582dea85156a821d78a522a0c083aa upstream.

It's possible for an initiator to send us an UNMAP command with a
descriptor that is less than 8 bytes; in that case it's really bad for
us to set an unsigned int to that value, subtract 8 from it, and then
use that as a limit for our loop (since the value will wrap around to
a huge positive value).

Fix this by making size be signed and only looping if size &gt;= 16 (ie
if we have at least a full descriptor available).

Also remove offset as an obfuscated name for the constant 8.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>target: Fix reading of data length fields for UNMAP commands</title>
<updated>2012-08-15T15:10:31Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-07-16T22:34:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fb6469c601a80a0c883ec0be189ecf1677ecf56'/>
<id>urn:sha1:6fb6469c601a80a0c883ec0be189ecf1677ecf56</id>
<content type='text'>
commit 1a5fa4576ec8a462313c7516b31d7453481ddbe8 upstream.

The UNMAP DATA LENGTH and UNMAP BLOCK DESCRIPTOR DATA LENGTH fields
are in the unmap descriptor (the payload transferred to our data out
buffer), not in the CDB itself.  Read them from the correct place in
target_emulated_unmap.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>target: Add range checking to UNMAP emulation</title>
<updated>2012-08-15T15:10:31Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-07-16T22:34:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74c90d4c3e5ee158cec2f6f32f6fb3cbfc0a2f47'/>
<id>urn:sha1:74c90d4c3e5ee158cec2f6f32f6fb3cbfc0a2f47</id>
<content type='text'>
commit 2594e29865c291db162313187612cd9f14538f33 upstream.

When processing an UNMAP command, we need to make sure that the number
of blocks we're asked to UNMAP does not exceed our reported maximum
number of blocks per UNMAP, and that the range of blocks we're
unmapping doesn't go past the end of the device.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: adjust filename, context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>target: Fix range calculation in WRITE SAME emulation when num blocks == 0</title>
<updated>2012-07-29T15:04:18Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-07-17T00:10:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c8c9e57270fc5f54aa02144f7280f91ee2e3334'/>
<id>urn:sha1:5c8c9e57270fc5f54aa02144f7280f91ee2e3334</id>
<content type='text'>
commit 1765fe5edcb83f53fc67edeb559fcf4bc82c6460 upstream.

When NUMBER OF LOGICAL BLOCKS is 0, WRITE SAME is supposed to write
all the blocks from the specified LBA through the end of the device.
However, dev-&gt;transport-&gt;get_blocks(dev) (perhaps confusingly) returns
the last valid LBA rather than the number of blocks, so the correct
number of blocks to write starting with lba is

dev-&gt;transport-&gt;get_blocks(dev) - lba + 1

(nab: Backport roland's for-3.6 patch to for-3.5)

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: Remove hack to make READ CAPACITY(10) lie if thin provisioning is enabled</title>
<updated>2012-03-16T02:14:48Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-03-14T17:12:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1f6fa8f8179dd66345d59f067f2a48a86095c499'/>
<id>urn:sha1:1f6fa8f8179dd66345d59f067f2a48a86095c499</id>
<content type='text'>
Remove the hack that has READ CAPACITY(10) return 0xFFFFFFFF as the
number of sectors when thin provisioning is enabled.  This is supposed
to trigger the initiator to use READ CAPACITY(16) in this case so that
it finds out about thin provisioning.  But an initiator that cares about
thin provisioning is going to ask anyway, and an initiator that doesn't
know about READ CAPACITY(16) is going to get the wrong capacity.  So
just have READ CAPACITY(10) return the size it's supposed to.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Untangle front-end and back-end meanings of max_sectors attribute</title>
<updated>2012-02-25T22:37:49Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-02-14T00:18:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=015487b89f27d91d95a056cdc3c85e6c729bff12'/>
<id>urn:sha1:015487b89f27d91d95a056cdc3c85e6c729bff12</id>
<content type='text'>
se_dev_attrib.max_sectors currently has two independent meanings:

 - It is reported in the block limits VPD page as the maximum transfer
   length, ie the largest IO that the front-end (fabric) can handle.
   Also the target core doesn't enforce this maximum transfer length.

 - It is used to hold the size of the largest IO that the back-end can
   handle, so we know when to split SCSI commands into multiple tasks.

Fix this by adding a new se_dev_attrib.fabric_max_sectors to hold the
maximum transfer length, and checking incoming IOs against that limit.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Don't set WBUS16 or SYNC bits in INQUIRY response</title>
<updated>2012-02-25T22:37:49Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-02-14T00:18:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=effc6cc8828257c32c37635e737f14fd6e19ecd7'/>
<id>urn:sha1:effc6cc8828257c32c37635e737f14fd6e19ecd7</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Set peripheral device type consistently in INQUIRY response</title>
<updated>2012-02-25T22:37:49Z</updated>
<author>
<name>Roland Dreier</name>
</author>
<published>2012-02-14T00:18:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=089461dda1770c10fea0b988ff74519a9be81d7e'/>
<id>urn:sha1:089461dda1770c10fea0b988ff74519a9be81d7e</id>
<content type='text'>
Current code sets the peripheral device type to 0x3f == "not present
unknown" for virtual LUN 0 for standard INQUIRY commands, but leaves it
as 0 == "connected direct access block" for VPD INQUIRY commands.  This
is just because the check for LUN 0 only happens in some code paths.

Make our peripheral device type consistent by moving the LUN 0 check
into the common emulate_inquiry() code.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
