<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/target/iscsi, branch v3.2.29</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.29</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.2.29'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2012-08-02T13:37:57Z</updated>
<entry>
<title>iscsi-target: Drop bogus struct file usage for iSCSI/SCTP</title>
<updated>2012-08-02T13:37:57Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e87ebd5357b62b81c70d36c79b1945b45c4c8404'/>
<id>urn:sha1:e87ebd5357b62b81c70d36c79b1945b45c4c8404</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;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Fix dynamic -&gt; explict NodeACL pointer reference</title>
<updated>2012-04-02T16:52:45Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-02-27T06:16:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=abd8ea073d7438c42004aac75d4bbb46e7a8c054'/>
<id>urn:sha1:abd8ea073d7438c42004aac75d4bbb46e7a8c054</id>
<content type='text'>
commit d06283341aee9e48eff1b068779d340785c635ce upstream.

This patch fixes a free after use in lio_target_make_nodeacl() where
iscsi_node_acl was referenced from the original se_nacl_new allocation,
instead of from core_tpg_add_initiator_node_acl() in the case of dynamic
-&gt; explict NodeACL conversion.

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>iscsi-target: Fix iscsit_alloc_buffs() failure cases</title>
<updated>2012-04-02T16:52:44Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-02-24T01:28:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=05ea4968dcc95650e2d1e1b67102018cdbd80e65'/>
<id>urn:sha1:05ea4968dcc95650e2d1e1b67102018cdbd80e65</id>
<content type='text'>
commit d335e6054db616bce3f040e659fa38440518ad1d upstream.

Make iscsit_alloc_buffs() failure case for page_alloc_failed use correct
__free_page() SGL pointer, and return -ENOMEM for iscsit_allocate_iovecs
failure to push se_cmd-&gt;t_mem_sg release into iscsit_release_cmd()
callback during iscsit_add_reject_from_cmd() connection reset.

Also drop cmd-&gt;t_mem_sg = NULL assignment from page_alloc_failed
failure case.

Reported-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;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iscsi-target: Fix reservation conflict -EBUSY response handling bug</title>
<updated>2012-03-19T16:02:36Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-03-14T01:20:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=980b16ee8122615e15197b0a747d924c3b35b6bd'/>
<id>urn:sha1:980b16ee8122615e15197b0a747d924c3b35b6bd</id>
<content type='text'>
commit 00fdc6bbef77844ce397a7de7acfaf25e8e2e4eb upstream.

This patch addresses a iscsi-target specific bug related to reservation conflict
handling in iscsit_handle_scsi_cmd() that has been causing reservation conflicts
to complete and not fail as expected due to incorrect errno checking.  The problem
occured with the change to return -EBUSY from transport_generic_cmd_sequencer() -&gt;
transport_generic_allocate_tasks() failures, that broke iscsit_handle_scsi_cmd()
checking for -EINVAL in order to invoke a non GOOD status response.

This was manifesting itself as data corruption with legacy SPC-2 reservations,
but also effects iscsi-target LUNs with SPC-3 persistent reservations.

This bug was originally introduced in lio-core commit:

commit 03e98c9eb916f3f0868c1dc344dde2a60287ff72
Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Date:   Fri Nov 4 02:36:16 2011 -0700

    target: Address legacy PYX_TRANSPORT_* return code breakage

Reported-by: Martin Svec &lt;martin.svec@zoner.cz&gt;
Cc: Martin Svec &lt;martin.svec@zoner.cz&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>iscsi-target: Fix discovery with INADDR_ANY and IN6ADDR_ANY_INIT</title>
<updated>2012-02-13T19:16:59Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-01-17T07:33:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7b88c23d62bcaf794ebd97400869d00f00befcd6'/>
<id>urn:sha1:7b88c23d62bcaf794ebd97400869d00f00befcd6</id>
<content type='text'>
commit 2f9bc894c67dbacae5a6a9875818d2a18a918d18 upstream.

This patch addresses a bug with sendtargets discovery where INADDR_ANY (0.0.0.0)
+ IN6ADDR_ANY_INIT ([0:0:0:0:0:0:0:0]) network portals where incorrectly being
reported back to initiators instead of the address of the connecting interface.
To address this, save local socket -&gt;getname() output during iscsi login setup,
and makes iscsit_build_sendtargets_response() return these TargetAddress keys
when INADDR_ANY or IN6ADDR_ANY_INIT portals are in use.

Reported-by: Dax Kelson &lt;dkelson@gurulabs.com&gt;
Reported-by: Andy Grover &lt;agrover@redhat.com&gt;
Cc: David S. Miller &lt;davem@davemloft.net&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>iscsi-target: Fix double list_add with iscsit_alloc_buffs reject</title>
<updated>2012-02-13T19:16:59Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-01-17T01:11:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=49f4afd3b15866b16b72691a6060fad041e8f2dc'/>
<id>urn:sha1:49f4afd3b15866b16b72691a6060fad041e8f2dc</id>
<content type='text'>
commit cd931ee62fd0258fc85c76a7c5499fe85e0f3436 upstream.

This patch fixes a bug where the iscsit_add_reject_from_cmd() call
from a failure to iscsit_alloc_buffs() was incorrectly passing
add_to_conn=1 and causing a double list_add after iscsi_cmd-&gt;i_list
had already been added in iscsit_handle_scsi_cmd().

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>iscsi-target: Fix reject release handling in iscsit_free_cmd()</title>
<updated>2012-02-13T19:16:59Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-01-17T00:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=fa577fc1c4b43933b74efe8d44075ef93f289516'/>
<id>urn:sha1:fa577fc1c4b43933b74efe8d44075ef93f289516</id>
<content type='text'>
commit c1ce4bd56f2846de55043374598fd929ad3b711b upstream.

This patch addresses a bug where iscsit_free_cmd() was incorrectly calling
iscsit_release_cmd() for ISCSI_OP_REJECT because iscsi_add_reject*() will
overwrite the original iscsi_cmd-&gt;iscsi_opcode assignment.  This bug was
introduced with the following commit:

commit 0be67f2ed8f577d2c72d917928394c5885fa9134
Author: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Date:   Sun Oct 9 01:48:14 2011 -0700

    iscsi-target: Remove SCF_SE_LUN_CMD flag abuses

and was manifesting itself as list corruption with the following:

[  131.191092] ------------[ cut here ]------------
[  131.191092] WARNING: at lib/list_debug.c:53 __list_del_entry+0x8d/0x98()
[  131.191092] Hardware name: VMware Virtual Platform
[  131.191092] list_del corruption. prev-&gt;next should be ffff880022d3c100, but was 6b6b6b6b6b6b6b6b
[  131.191092] Modules linked in: tcm_vhost ib_srpt ib_cm ib_sa ib_mad ib_core tcm_qla2xxx qla2xxx tcm_loop tcm_fc libfc scsi_transport_fc crc32c iscsi_target_mod target_core_stgt scsi_tgt target_core_pscsi target_core_file target_core_iblock target_core_mod configfs ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi sr_mod cdrom sd_mod e1000 ata_piix libata mptspi mptscsih mptbase [last unloaded: scsi_wait_scan]
[  131.191092] Pid: 2250, comm: iscsi_ttx Tainted: G        W    3.2.0-rc4+ #42
[  131.191092] Call Trace:
[  131.191092]  [&lt;ffffffff8103b553&gt;] warn_slowpath_common+0x80/0x98
[  131.191092]  [&lt;ffffffff8103b5ff&gt;] warn_slowpath_fmt+0x41/0x43
[  131.191092]  [&lt;ffffffff811d0279&gt;] __list_del_entry+0x8d/0x98
[  131.191092]  [&lt;ffffffffa01395c9&gt;] transport_lun_remove_cmd+0x9b/0xb7 [target_core_mod]
[  131.191092]  [&lt;ffffffffa013a55c&gt;] transport_generic_free_cmd+0x5d/0x71 [target_core_mod]
[  131.191092]  [&lt;ffffffffa01a012b&gt;] iscsit_free_cmd+0x1e/0x27 [iscsi_target_mod]
[  131.191092]  [&lt;ffffffffa01a13be&gt;] iscsit_close_connection+0x14d/0x5b2 [iscsi_target_mod]
[  131.191092]  [&lt;ffffffffa0196a0c&gt;] iscsit_take_action_for_connection_exit+0xdb/0xe0 [iscsi_target_mod]
[  131.191092]  [&lt;ffffffffa01a55d4&gt;] iscsi_target_tx_thread+0x15cb/0x1608 [iscsi_target_mod]
[  131.191092]  [&lt;ffffffff8103609a&gt;] ? check_preempt_wakeup+0x121/0x185
[  131.191092]  [&lt;ffffffff81030801&gt;] ? __dequeue_entity+0x2e/0x33
[  131.191092]  [&lt;ffffffffa01a4009&gt;] ? iscsit_send_text_rsp+0x25f/0x25f [iscsi_target_mod]
[  131.191092]  [&lt;ffffffffa01a4009&gt;] ? iscsit_send_text_rsp+0x25f/0x25f [iscsi_target_mod]
[  131.191092]  [&lt;ffffffff8138f706&gt;] ? schedule+0x55/0x57
[  131.191092]  [&lt;ffffffff81056c7d&gt;] kthread+0x7d/0x85
[  131.191092]  [&lt;ffffffff81399534&gt;] kernel_thread_helper+0x4/0x10
[  131.191092]  [&lt;ffffffff81056c00&gt;] ? kthread_worker_fn+0x16d/0x16d
[  131.191092]  [&lt;ffffffff81399530&gt;] ? gs_change+0x13/0x13

Reported-by: &lt;jrepac@yahoo.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>iscsi-target: Fix hex2bin warn_unused compile message</title>
<updated>2011-12-06T06:00:59Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-12-06T05:24:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ddca8f3ed36c5d25363dab6762829868af09cb02'/>
<id>urn:sha1:ddca8f3ed36c5d25363dab6762829868af09cb02</id>
<content type='text'>
Fix the following compile warning with hex2bin() usage:

drivers/target/iscsi/iscsi_target_auth.c: In function ‘chap_string_to_hex’:
drivers/target/iscsi/iscsi_target_auth.c:35: warning: ignoring return value of ‘hex2bin’, declared with attribute warn_unused_result

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: remove unused struct fields</title>
<updated>2011-12-06T06:00:56Z</updated>
<author>
<name>Jörn Engel</name>
<email>joern@logfs.org</email>
</author>
<published>2011-11-24T01:04:16Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c73b678f729ea087ef57b59a5d7b5dd3a97042b'/>
<id>urn:sha1:5c73b678f729ea087ef57b59a5d7b5dd3a97042b</id>
<content type='text'>
Some are never used, some are set but never read, dev_hoq_count is
incremented and decremented, but never read.

Signed-off-by: Joern Engel &lt;joern@logfs.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Use kmemdup rather than duplicating its implementation</title>
<updated>2011-12-06T06:00:55Z</updated>
<author>
<name>Thomas Meyer</name>
<email>thomas@m3y3r.de</email>
</author>
<published>2011-11-17T22:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1c3d5794fc4a2afd2258b3aa6406377934a36663'/>
<id>urn:sha1:1c3d5794fc4a2afd2258b3aa6406377934a36663</id>
<content type='text'>
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.

Signed-off-by: Thomas Meyer &lt;thomas@m3y3r.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
