<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/target/target_core_cdb.c, branch linux-3.5.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.5.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.5.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2012-08-15T14:53:02Z</updated>
<entry>
<title>target: Check number of unmap descriptors against our limit</title>
<updated>2012-08-15T14:53:02Z</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=120d8b93b0eb7d868c612db14ca7f47d032dfc6f'/>
<id>urn:sha1:120d8b93b0eb7d868c612db14ca7f47d032dfc6f</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-15T14:53:02Z</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=69722bcb5130778d70e34a2706cd041cecd98b1b'/>
<id>urn:sha1:69722bcb5130778d70e34a2706cd041cecd98b1b</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-15T14:53:02Z</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=8ed22428989de32402369198483f33ddfc957c64'/>
<id>urn:sha1:8ed22428989de32402369198483f33ddfc957c64</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-15T14:53:02Z</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=db72573b925c8258376aecaf7df99debfae11384'/>
<id>urn:sha1:db72573b925c8258376aecaf7df99debfae11384</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-17T00:10:17Z</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=1765fe5edcb83f53fc67edeb559fcf4bc82c6460'/>
<id>urn:sha1:1765fe5edcb83f53fc67edeb559fcf4bc82c6460</id>
<content type='text'>
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;
Cc: Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Remove max_sectors device attribute for modern se_task less code</title>
<updated>2012-05-09T22:08:47Z</updated>
<author>
<name>Nicholas Bellinger</name>
</author>
<published>2012-05-09T19:42:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11e764bd5ed4bb930e0ec5dd161df58307507347'/>
<id>urn:sha1:11e764bd5ed4bb930e0ec5dd161df58307507347</id>
<content type='text'>
This patch removes the original usage of dev_attr-&gt;max_sectors in favor of
dev_attr-&gt;hw_max_sectors that is now being enforced by target core from
within transport_generic_cmd_sequencer() for SCF_SCSI_DATA_SG_IO_CDB ops.

After the recent se_task removal patches from hch, this value for IBLOCK
backends being set via configfs by userspace from an saved max_sectors
value that is turning out to be problematic, so it makes sense to go ahead
and remove this now legacy attribute all-together.

This patch also continues to make se_dev_set_default_attribs() do
(sectors / block_size) alignment for what actually get used by
target_core_mod to be safe here, following the same alignment currently
used by fabric_max_sectors.

Reported-by: Andy Grover &lt;agrover@redhat.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: replace -&gt;execute_task with -&gt;execute_cmd</title>
<updated>2012-05-06T22:11:14Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2012-04-23T15:35:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6bb35e009b656b36f7985057822c5fbf53ea75b7'/>
<id>urn:sha1:6bb35e009b656b36f7985057822c5fbf53ea75b7</id>
<content type='text'>
Make CDB emulation work on commands instead of tasks again as a preparation
of removing tasks completely.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: remove target_get_task_cdb</title>
<updated>2012-05-06T22:02:59Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2012-04-23T15:35:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ed3102c678c6274933948f9097bb4e2b314e5f82'/>
<id>urn:sha1:ed3102c678c6274933948f9097bb4e2b314e5f82</id>
<content type='text'>
Now that tasks are always the same size as the command there is no need
to rewrite a CDB in common code.  Notw that we keep the separately allocated
CDB in the pscsi and stgt backends for now, to easy reintroducing any
command splitting local to these backends if nessecary.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: stop splitting commands into multiple tasks</title>
<updated>2012-04-15T00:40:31Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2012-03-26T21:53:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bebe2fdc17835f9330de2a15c8ca393f92acd250'/>
<id>urn:sha1:bebe2fdc17835f9330de2a15c8ca393f92acd250</id>
<content type='text'>
From hch:

The high-performance backends (iblock and rd) support tasks of unlimited
size.  With that there is no reason to keep a complex infrastructure for
splitting up commands in place.  Stop doing so and only submit a single
task per data direction.  Once this is in place we can slowly remove fields
from the task that duplicate things in the command, or move other fields
into the command.

From nab:

The benefit to IBLOCK performance by removing the additional
fast-path allocation overhead + SGL mapping to se_task-&gt;task_sg[] is now
greater than transparently supporting an received CDB I/O length that
exceeds what is allowed by backend pSCSI LLD hardware max_sectors, that
was originally supported for all backend export cases.

This change may effect some users of pSCSI users on legacy hardware, but
I think most folks are now using TYPE_DISK struct scsi_device export
with IBLOCK.  The only other place where this may can issues that cannot
be resolved with IBLOCK TYPE_DISK is using TYPE_ROM, TYPE_TAPE or other
pSCSI non TYPE_DISK export with an SCSI LLDs using a smaller
max_sectors.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.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>
</feed>
