<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target, branch v3.4.8</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/target?h=v3.4.8</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/target?h=v3.4.8'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-08-09T15:31:26Z</updated>
<entry>
<title>iscsi-target: Drop bogus struct file usage for iSCSI/SCTP</title>
<updated>2012-08-09T15:31:26Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2012-07-21T07:55:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f1377fddb346729aa2fe9cdbfc54aaf2ca463bd5'/>
<id>urn:sha1:f1377fddb346729aa2fe9cdbfc54aaf2ca463bd5</id>
<content type='text'>
commit bf6932f44a7b3fa7e2246a8b18a44670e5eab6c2 upstream.

From Al Viro:

	BTW, speaking of struct file treatment related to sockets -
        there's this piece of code in iscsi:
        /*
         * The SCTP stack needs struct socket-&gt;file.
         */
        if ((np-&gt;np_network_transport == ISCSI_SCTP_TCP) ||
            (np-&gt;np_network_transport == ISCSI_SCTP_UDP)) {
                if (!new_sock-&gt;file) {
                        new_sock-&gt;file = kzalloc(
                                        sizeof(struct file), GFP_KERNEL);

For one thing, as far as I can see it'not true - sctp does *not* depend on
socket-&gt;file being non-NULL; it does, in one place, check socket-&gt;file-&gt;f_flags
for O_NONBLOCK, but there it treats NULL socket-&gt;file as "flag not set".
Which is the case here anyway - the fake struct file created in
__iscsi_target_login_thread() (and in iscsi_target_setup_login_socket(), with
the same excuse) do *not* get that flag set.

Moreover, it's a bloody serious violation of a bunch of asserts in VFS;
all struct file instances should come from filp_cachep, via get_empty_filp()
(or alloc_file(), which is a wrapper for it).  FWIW, I'm very tempted to
do this and be done with the entire mess:

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Andy Grover &lt;agrover@redhat.com&gt;
Cc: Hannes Reinecke &lt;hare@suse.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: Add generation of LOGICAL BLOCK ADDRESS OUT OF RANGE</title>
<updated>2012-08-09T15:31:26Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-07-16T22:34:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=480692b1562b07a4bb8e4d6e49bf7fd2acefbea2'/>
<id>urn:sha1:480692b1562b07a4bb8e4d6e49bf7fd2acefbea2</id>
<content type='text'>
commit e2397c704429025bc6b331a970f699e52f34283e upstream.

Many SCSI commands are defined to return a CHECK CONDITION / ILLEGAL
REQUEST with ASC set to LOGICAL BLOCK ADDRESS OUT OF RANGE if the
initiator sends a command that accesses a too-big LBA.  Add an enum
value and case entries so that target code can return this status.

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 crash seen with aborts and large reads</title>
<updated>2012-07-29T15:04:18Z</updated>
<author>
<name>Mark Rustad</name>
<email>mark.d.rustad@intel.com</email>
</author>
<published>2012-07-14T01:18:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8db5153f9dca89afbeebe0b077e7cc1e5827e07a'/>
<id>urn:sha1:8db5153f9dca89afbeebe0b077e7cc1e5827e07a</id>
<content type='text'>
commit 3cc5d2a6b9a2fd1bf024aa5e52dd22961eecaf13 upstream.

This patch fixes a crash seen when large reads have their exchange
aborted by either timing out or being reset. Because the exchange
abort results in the seq pointer being set to NULL, because the
sequence is no longer valid, it must not be dereferenced. This
patch changes the function ft_get_task_tag to return ~0 if it is
unable to get the tag for this reason. Because the get_task_tag
interface provides no means of returning an error, this seems
like the best way to fix this issue at the moment.

Signed-off-by: Mark Rustad &lt;mark.d.rustad@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 range calculation in WRITE SAME emulation when num blocks == 0</title>
<updated>2012-07-29T15:04:18Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-07-17T00:10:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/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: Clean up returning errors in PR handling code</title>
<updated>2012-07-29T15:04:18Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-07-16T22:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=815faab2c4b7deb2cc6495186307ceb0983214a9'/>
<id>urn:sha1:815faab2c4b7deb2cc6495186307ceb0983214a9</id>
<content type='text'>
commit d35212f3ca3bf4fb49d15e37f530c9931e2d2183 upstream.

 - instead of (PTR_ERR(file) &lt; 0) just use IS_ERR(file)
 - return -EINVAL instead of EINVAL
 - all other error returns in target_scsi3_emulate_pr_out() use
   "goto out" -- get rid of the one remaining straight "return."

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: Resolve suspicious RCU usage warnings</title>
<updated>2012-07-16T16:04:24Z</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=1ee0932804c2526efca4c6623911b07f6992eb3f'/>
<id>urn:sha1:1ee0932804c2526efca4c6623911b07f6992eb3f</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: Return error to initiator if SET TARGET PORT GROUPS emulation fails</title>
<updated>2012-06-22T18:37:17Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-06-05T06:24:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f5f062e1be5fdafaa68c4dd97a2d64ef78458b37'/>
<id>urn:sha1:f5f062e1be5fdafaa68c4dd97a2d64ef78458b37</id>
<content type='text'>
commit 59e4f541baf728dbb426949bfa9f6862387ffd0e upstream.

The error paths in target_emulate_set_target_port_groups() are all
essentially "rc = -EINVAL; goto out;" but the code at "out:" ignores
rc and always returns success.  This means that even if eg explicit
ALUA is turned off, the initiator will always see a good SCSI status
for SET TARGET PORT GROUPS.

Fix this by returning rc as is intended.  It appears this bug was
added by the following patch:

commit 05d1c7c0d0db4cc25548d9aadebb416888a82327
Author: Andy Grover &lt;agrover@redhat.com&gt;
Date:   Wed Jul 20 19:13:28 2011 +0000

    target: Make all control CDBs scatter-gather

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Cc: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
[bwh: Backported to 3.2: we have transport_complete_task()
 and not target_complete_cmd()]
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 bug in handling of FILEIO + block_device resize ops</title>
<updated>2012-05-17T19:02:43Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-05-16T23:05:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cd9323fd68aee3c1c6b5b21e5746c9d1b586fb58'/>
<id>urn:sha1:cd9323fd68aee3c1c6b5b21e5746c9d1b586fb58</id>
<content type='text'>
This patch fixes a bug in the handling of FILEIO w/ underlying block_device
resize operations where the original fd_dev-&gt;fd_dev_size was incorrectly being
used in fd_get_blocks() for READ_CAPACITY response payloads.

This patch avoids using fd_dev-&gt;fd_dev_size for FILEIO devices with
an underlying block_device, and instead changes fd_get_blocks() to
get the sector count directly from i_size_read() as recommended by hch.

Reported-by: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Fix SPC-2 RELEASE bug for multi-session iSCSI client setups</title>
<updated>2012-05-14T22:13:50Z</updated>
<author>
<name>Bernhard Kohl</name>
<email>Riedel-und-Kohl@t-online.de</email>
</author>
<published>2012-05-13T21:39:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=edc318d9fea6854df752ec8c645b960b0d5a1d23'/>
<id>urn:sha1:edc318d9fea6854df752ec8c645b960b0d5a1d23</id>
<content type='text'>
This patch addresses a bug in a special case for target core SPC-2 RELEASE
logic where the same physical client (eg: iSCSI InitiatorName) with
differing iSCSI session identifiers (ISID) is allowed to incorrectly release
the same client's SPC-2 reservation from the non reservation holding path.

Note this bug is specific to iscsi-target w/ SPC-2 reservations, and
with the default enforce_pr_isids=1 device attr setting in target-core
controls if a InitiatorName + different ISID reservations are handled
the same as a single iSCSI client entity.

Signed-off-by: Bernhard Kohl &lt;bernhard.kohl@gmx.net&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Drop incorrect se_lun_acl release for dynamic -&gt; explict ACL conversion</title>
<updated>2012-05-11T21:55:19Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-05-11T05:05:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cfebf8f42f47327fa54cf05c19b98f4bd5236a26'/>
<id>urn:sha1:cfebf8f42f47327fa54cf05c19b98f4bd5236a26</id>
<content type='text'>
This patch removes some potentially problematic legacy code within
core_clear_initiator_node_from_tpg() that was originally intended to
release left over se_lun_acl setup during dynamic NodeACL+MappedLUN
generate when running with TPG demo-mode operation.

Since we now only ever expect to allocate and release se_lun_acl from
within target_core_fabric_configfs.c:target_fabric_make_mappedlun() and
target_fabric_drop_mappedlun() context respectively, this code for
demo-mode release is incorrect and needs to be removed.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Andy Grover &lt;agrover@redhat.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
