<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/target, branch v3.0.79</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs</title>
<updated>2013-04-17T04:02:31+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2013-04-10T22:00:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3d91fc30b72e90319f1bb35905e284b58b976d6f'/>
<id>3d91fc30b72e90319f1bb35905e284b58b976d6f</id>
<content type='text'>
commit 30f359a6f9da65a66de8cadf959f0f4a0d498bba upstream.

This patch fixes a bug where a handful of informational / control CDBs
that should be allowed during ALUA access state Standby/Offline/Transition
where incorrectly returning CHECK_CONDITION + ASCQ_04H_ALUA_TG_PT_*.

This includes INQUIRY + REPORT_LUNS, which would end up preventing LUN
registration when LUN scanning occured during these ALUA access states.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 30f359a6f9da65a66de8cadf959f0f4a0d498bba upstream.

This patch fixes a bug where a handful of informational / control CDBs
that should be allowed during ALUA access state Standby/Offline/Transition
where incorrectly returning CHECK_CONDITION + ASCQ_04H_ALUA_TG_PT_*.

This includes INQUIRY + REPORT_LUNS, which would end up preventing LUN
registration when LUN scanning occured during these ALUA access states.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Cc: Hannes Reinecke &lt;hare@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>target/pscsi: Fix page increment</title>
<updated>2013-03-14T18:32:04+00:00</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-02-27T05:29:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=21a3473f1b9aaf7a458b43acb5237794e8cecadb'/>
<id>21a3473f1b9aaf7a458b43acb5237794e8cecadb</id>
<content type='text'>
commit 472b72f2db7831d7dbe22ffdff4adee3bd49b05d upstream.

The page++ is wrong. It makes bio_add_pc_page() pointing to a wrong page
address if the 'while (len &gt; 0 &amp;&amp; data_len &gt; 0) { ... }' loop is
executed more than one once.

Signed-off-by: Asias He &lt;asias@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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 472b72f2db7831d7dbe22ffdff4adee3bd49b05d upstream.

The page++ is wrong. It makes bio_add_pc_page() pointing to a wrong page
address if the 'while (len &gt; 0 &amp;&amp; data_len &gt; 0) { ... }' loop is
executed more than one once.

Signed-off-by: Asias He &lt;asias@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;

</pre>
</div>
</content>
</entry>
<entry>
<title>target: Add missing mapped_lun bounds checking during make_mappedlun setup</title>
<updated>2013-03-03T22:09:04+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2013-02-19T02:31:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=954497ea2037e8c42fe1c7a0882030b62ac9116c'/>
<id>954497ea2037e8c42fe1c7a0882030b62ac9116c</id>
<content type='text'>
commit fbbf8555a986ed31e54f006b6cc637ea4ff1425b upstream.

This patch adds missing bounds checking for the configfs provided
mapped_lun value during target_fabric_make_mappedlun() setup ahead
of se_lun_acl initialization.

This addresses a potential OOPs when using a mapped_lun value that
exceeds the hardcoded TRANSPORT_MAX_LUNS_PER_TPG-1 value within
se_node_acl-&gt;device_list[].

Reported-by: Jan Engelhardt &lt;jengelh@inai.de&gt;
Cc: Jan Engelhardt &lt;jengelh@inai.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit fbbf8555a986ed31e54f006b6cc637ea4ff1425b upstream.

This patch adds missing bounds checking for the configfs provided
mapped_lun value during target_fabric_make_mappedlun() setup ahead
of se_lun_acl initialization.

This addresses a potential OOPs when using a mapped_lun value that
exceeds the hardcoded TRANSPORT_MAX_LUNS_PER_TPG-1 value within
se_node_acl-&gt;device_list[].

Reported-by: Jan Engelhardt &lt;jengelh@inai.de&gt;
Cc: Jan Engelhardt &lt;jengelh@inai.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>tcm_fc: Do not report target role when target is not defined</title>
<updated>2013-01-21T19:44:58+00:00</updated>
<author>
<name>Mark Rustad</name>
<email>mark.d.rustad@intel.com</email>
</author>
<published>2012-12-21T18:58:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5304f42eab6d502a281337ec493b108d863da964'/>
<id>5304f42eab6d502a281337ec493b108d863da964</id>
<content type='text'>
commit edec8dfefa1f372b2dd8197da555352e76a10c03 upstream.

Clear the target role when no target is provided for
the node performing a PRLI.

Signed-off-by: Mark Rustad &lt;mark.d.rustad@intel.com&gt;
Reviewed-by: Bhanu Prakash Gollapudi &lt;bprakash@broadcom.com&gt;
Acked by Robert Love &lt;robert.w.love@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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit edec8dfefa1f372b2dd8197da555352e76a10c03 upstream.

Clear the target role when no target is provided for
the node performing a PRLI.

Signed-off-by: Mark Rustad &lt;mark.d.rustad@intel.com&gt;
Reviewed-by: Bhanu Prakash Gollapudi &lt;bprakash@broadcom.com&gt;
Acked by Robert Love &lt;robert.w.love@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;

</pre>
</div>
</content>
</entry>
<entry>
<title>tcm_fc: Do not indicate retry capability to initiators</title>
<updated>2013-01-21T19:44:58+00:00</updated>
<author>
<name>Mark Rustad</name>
<email>mark.d.rustad@intel.com</email>
</author>
<published>2012-12-21T18:58:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ed46841dd015efca61c4fec2f1b3edbe1c20f6d4'/>
<id>ed46841dd015efca61c4fec2f1b3edbe1c20f6d4</id>
<content type='text'>
commit f2eeba214bcd0215b7f558cab6420e5fd153042b upstream.

When generating a PRLI response to an initiator, clear the
FCP_SPPF_RETRY bit in the response.

Signed-off-by: Mark Rustad &lt;mark.d.rustad@intel.com&gt;
Reviewed-by: Bhanu Prakash Gollapudi &lt;bprakash@broadcom.com&gt;
Acked by Robert Love &lt;robert.w.love@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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f2eeba214bcd0215b7f558cab6420e5fd153042b upstream.

When generating a PRLI response to an initiator, clear the
FCP_SPPF_RETRY bit in the response.

Signed-off-by: Mark Rustad &lt;mark.d.rustad@intel.com&gt;
Reviewed-by: Bhanu Prakash Gollapudi &lt;bprakash@broadcom.com&gt;
Acked by Robert Love &lt;robert.w.love@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;

</pre>
</div>
</content>
</entry>
<entry>
<title>target/tcm_fc: fix the lockdep warning due to inconsistent lock state</title>
<updated>2013-01-17T16:43:54+00:00</updated>
<author>
<name>Yi Zou</name>
<email>yi.zou@intel.com</email>
</author>
<published>2012-12-11T01:04:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=52ae560ee055f41b4631db337c509040cf1d5109'/>
<id>52ae560ee055f41b4631db337c509040cf1d5109</id>
<content type='text'>
commit 9f4ad44b264f8bb61ffdd607148215566568430d upstream.

The lockdep warning below is in theory correct but it will be in really weird
rare situation that ends up that deadlock since the tcm fc session is hashed
based the rport id. Nonetheless, the complaining below is about rcu callback
that does the transport_deregister_session() is happening in softirq, where
transport_register_session() that happens earlier is not. This triggers the
lockdep warning below. So, just fix this to make lockdep happy by disabling
the soft irq before calling transport_register_session() in ft_prli.

BTW, this was found in FCoE VN2VN over two VMs, couple of create and destroy
would get this triggered.

v1: was enforcing register to be in softirq context which was not righ. See,
http://www.spinics.net/lists/target-devel/msg03614.html

v2: following comments from Roland&amp;Nick (thanks), it seems we don't have to
do transport_deregister_session() in rcu callback, so move it into ft_sess_free()
but still do kfree() of the corresponding ft_sess struct in rcu callback to
make sure the ft_sess is not freed till the rcu callback.

...
[ 1328.370592] scsi2 : FCoE Driver
[ 1328.383429] fcoe: No FDMI support.
[ 1328.384509] host2: libfc: Link up on port (000000)
[ 1328.934229] host2: Assigned Port ID 00a292
[ 1357.232132] host2: rport 00a393: Remove port
[ 1357.232568] host2: rport 00a393: Port sending LOGO from Ready state
[ 1357.233692] host2: rport 00a393: Delete port
[ 1357.234472] host2: rport 00a393: work event 3
[ 1357.234969] host2: rport 00a393: callback ev 3
[ 1357.235979] host2: rport 00a393: Received a LOGO response closed
[ 1357.236706] host2: rport 00a393: work delete
[ 1357.237481]
[ 1357.237631] =================================
[ 1357.238064] [ INFO: inconsistent lock state ]
[ 1357.238450] 3.7.0-rc7-yikvm+ #3 Tainted: G           O
[ 1357.238450] ---------------------------------
[ 1357.238450] inconsistent {SOFTIRQ-ON-W} -&gt; {IN-SOFTIRQ-W} usage.
[ 1357.238450] ksoftirqd/0/3 [HC0[0]:SC1[1]:HE0:SE0] takes:
[ 1357.238450]  (&amp;(&amp;se_tpg-&gt;session_lock)-&gt;rlock){+.?...}, at: [&lt;ffffffffa01eacd4&gt;] transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450] {SOFTIRQ-ON-W} state was registered at:
[ 1357.238450]   [&lt;ffffffff810834f5&gt;] mark_held_locks+0x6d/0x95
[ 1357.238450]   [&lt;ffffffff8108364a&gt;] trace_hardirqs_on_caller+0x12d/0x197
[ 1357.238450]   [&lt;ffffffff810836c1&gt;] trace_hardirqs_on+0xd/0xf
[ 1357.238450]   [&lt;ffffffff8149caba&gt;] _raw_spin_unlock_irq+0x2d/0x45
[ 1357.238450]   [&lt;ffffffffa01e8d10&gt;] __transport_register_session+0xb8/0x122 [target_core_mod]
[ 1357.238450]   [&lt;ffffffffa01e8dbe&gt;] transport_register_session+0x44/0x5a [target_core_mod]
[ 1357.238450]   [&lt;ffffffffa018e32c&gt;] ft_prli+0x1e3/0x275 [tcm_fc]
[ 1357.238450]   [&lt;ffffffffa0160e8d&gt;] fc_rport_recv_req+0x95e/0xdc5 [libfc]
[ 1357.238450]   [&lt;ffffffffa015be88&gt;] fc_lport_recv_els_req+0xc4/0xd5 [libfc]
[ 1357.238450]   [&lt;ffffffffa015c778&gt;] fc_lport_recv_req+0x12f/0x18f [libfc]
[ 1357.238450]   [&lt;ffffffffa015a6d7&gt;] fc_exch_recv+0x8ba/0x981 [libfc]
[ 1357.238450]   [&lt;ffffffffa0176d7a&gt;] fcoe_percpu_receive_thread+0x47a/0x4e2 [fcoe]
[ 1357.238450]   [&lt;ffffffff810549f1&gt;] kthread+0xb1/0xb9
[ 1357.238450]   [&lt;ffffffff814a40ec&gt;] ret_from_fork+0x7c/0xb0
[ 1357.238450] irq event stamp: 275411
[ 1357.238450] hardirqs last  enabled at (275410): [&lt;ffffffff810bb6a0&gt;] rcu_process_callbacks+0x229/0x42a
[ 1357.238450] hardirqs last disabled at (275411): [&lt;ffffffff8149c2f7&gt;] _raw_spin_lock_irqsave+0x22/0x8e
[ 1357.238450] softirqs last  enabled at (275394): [&lt;ffffffff8103d669&gt;] __do_softirq+0x246/0x26f
[ 1357.238450] softirqs last disabled at (275399): [&lt;ffffffff8103d6bb&gt;] run_ksoftirqd+0x29/0x62
[ 1357.238450]
[ 1357.238450] other info that might help us debug this:
[ 1357.238450]  Possible unsafe locking scenario:
[ 1357.238450]
[ 1357.238450]        CPU0
[ 1357.238450]        ----
[ 1357.238450]   lock(&amp;(&amp;se_tpg-&gt;session_lock)-&gt;rlock);
[ 1357.238450]   &lt;Interrupt&gt;
[ 1357.238450]     lock(&amp;(&amp;se_tpg-&gt;session_lock)-&gt;rlock);
[ 1357.238450]
[ 1357.238450]  *** DEADLOCK ***
[ 1357.238450]
[ 1357.238450] no locks held by ksoftirqd/0/3.
[ 1357.238450]
[ 1357.238450] stack backtrace:
[ 1357.238450] Pid: 3, comm: ksoftirqd/0 Tainted: G           O 3.7.0-rc7-yikvm+ #3
[ 1357.238450] Call Trace:
[ 1357.238450]  [&lt;ffffffff8149399a&gt;] print_usage_bug+0x1f5/0x206
[ 1357.238450]  [&lt;ffffffff8100da59&gt;] ? save_stack_trace+0x2c/0x49
[ 1357.238450]  [&lt;ffffffff81082aae&gt;] ? print_irq_inversion_bug.part.14+0x1ae/0x1ae
[ 1357.238450]  [&lt;ffffffff81083336&gt;] mark_lock+0x106/0x258
[ 1357.238450]  [&lt;ffffffff81084e34&gt;] __lock_acquire+0x2e7/0xe53
[ 1357.238450]  [&lt;ffffffff8102903d&gt;] ? pvclock_clocksource_read+0x48/0xb4
[ 1357.238450]  [&lt;ffffffff810ba6a3&gt;] ? rcu_process_gp_end+0xc0/0xc9
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffff81085ef1&gt;] lock_acquire+0x119/0x143
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffff8149c329&gt;] _raw_spin_lock_irqsave+0x54/0x8e
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffff810bb6a0&gt;] ? rcu_process_callbacks+0x229/0x42a
[ 1357.238450]  [&lt;ffffffffa018ddc5&gt;] ft_sess_rcu_free+0x17/0x24 [tcm_fc]
[ 1357.238450]  [&lt;ffffffffa018ddae&gt;] ? ft_sess_free+0x1b/0x1b [tcm_fc]
[ 1357.238450]  [&lt;ffffffff810bb6d7&gt;] rcu_process_callbacks+0x260/0x42a
[ 1357.238450]  [&lt;ffffffff8103d55d&gt;] __do_softirq+0x13a/0x26f
[ 1357.238450]  [&lt;ffffffff8149b34e&gt;] ? __schedule+0x65f/0x68e
[ 1357.238450]  [&lt;ffffffff8103d6bb&gt;] run_ksoftirqd+0x29/0x62
[ 1357.238450]  [&lt;ffffffff8105c83c&gt;] smpboot_thread_fn+0x1a5/0x1aa
[ 1357.238450]  [&lt;ffffffff8105c697&gt;] ? smpboot_unregister_percpu_thread+0x47/0x47
[ 1357.238450]  [&lt;ffffffff810549f1&gt;] kthread+0xb1/0xb9
[ 1357.238450]  [&lt;ffffffff8149b49d&gt;] ? wait_for_common+0xbb/0x10a
[ 1357.238450]  [&lt;ffffffff81054940&gt;] ? __init_kthread_worker+0x59/0x59
[ 1357.238450]  [&lt;ffffffff814a40ec&gt;] ret_from_fork+0x7c/0xb0
[ 1357.238450]  [&lt;ffffffff81054940&gt;] ? __init_kthread_worker+0x59/0x59
[ 1417.440099]  rport-2:0-0: blocked FC remote port time out: removing rport

Signed-off-by: Yi Zou &lt;yi.zou@intel.com&gt;
Cc: Open-FCoE &lt;devel@open-fcoe.org&gt;
Cc: Nicholas A. Bellinger &lt;nab@risingtidesystems.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 9f4ad44b264f8bb61ffdd607148215566568430d upstream.

The lockdep warning below is in theory correct but it will be in really weird
rare situation that ends up that deadlock since the tcm fc session is hashed
based the rport id. Nonetheless, the complaining below is about rcu callback
that does the transport_deregister_session() is happening in softirq, where
transport_register_session() that happens earlier is not. This triggers the
lockdep warning below. So, just fix this to make lockdep happy by disabling
the soft irq before calling transport_register_session() in ft_prli.

BTW, this was found in FCoE VN2VN over two VMs, couple of create and destroy
would get this triggered.

v1: was enforcing register to be in softirq context which was not righ. See,
http://www.spinics.net/lists/target-devel/msg03614.html

v2: following comments from Roland&amp;Nick (thanks), it seems we don't have to
do transport_deregister_session() in rcu callback, so move it into ft_sess_free()
but still do kfree() of the corresponding ft_sess struct in rcu callback to
make sure the ft_sess is not freed till the rcu callback.

...
[ 1328.370592] scsi2 : FCoE Driver
[ 1328.383429] fcoe: No FDMI support.
[ 1328.384509] host2: libfc: Link up on port (000000)
[ 1328.934229] host2: Assigned Port ID 00a292
[ 1357.232132] host2: rport 00a393: Remove port
[ 1357.232568] host2: rport 00a393: Port sending LOGO from Ready state
[ 1357.233692] host2: rport 00a393: Delete port
[ 1357.234472] host2: rport 00a393: work event 3
[ 1357.234969] host2: rport 00a393: callback ev 3
[ 1357.235979] host2: rport 00a393: Received a LOGO response closed
[ 1357.236706] host2: rport 00a393: work delete
[ 1357.237481]
[ 1357.237631] =================================
[ 1357.238064] [ INFO: inconsistent lock state ]
[ 1357.238450] 3.7.0-rc7-yikvm+ #3 Tainted: G           O
[ 1357.238450] ---------------------------------
[ 1357.238450] inconsistent {SOFTIRQ-ON-W} -&gt; {IN-SOFTIRQ-W} usage.
[ 1357.238450] ksoftirqd/0/3 [HC0[0]:SC1[1]:HE0:SE0] takes:
[ 1357.238450]  (&amp;(&amp;se_tpg-&gt;session_lock)-&gt;rlock){+.?...}, at: [&lt;ffffffffa01eacd4&gt;] transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450] {SOFTIRQ-ON-W} state was registered at:
[ 1357.238450]   [&lt;ffffffff810834f5&gt;] mark_held_locks+0x6d/0x95
[ 1357.238450]   [&lt;ffffffff8108364a&gt;] trace_hardirqs_on_caller+0x12d/0x197
[ 1357.238450]   [&lt;ffffffff810836c1&gt;] trace_hardirqs_on+0xd/0xf
[ 1357.238450]   [&lt;ffffffff8149caba&gt;] _raw_spin_unlock_irq+0x2d/0x45
[ 1357.238450]   [&lt;ffffffffa01e8d10&gt;] __transport_register_session+0xb8/0x122 [target_core_mod]
[ 1357.238450]   [&lt;ffffffffa01e8dbe&gt;] transport_register_session+0x44/0x5a [target_core_mod]
[ 1357.238450]   [&lt;ffffffffa018e32c&gt;] ft_prli+0x1e3/0x275 [tcm_fc]
[ 1357.238450]   [&lt;ffffffffa0160e8d&gt;] fc_rport_recv_req+0x95e/0xdc5 [libfc]
[ 1357.238450]   [&lt;ffffffffa015be88&gt;] fc_lport_recv_els_req+0xc4/0xd5 [libfc]
[ 1357.238450]   [&lt;ffffffffa015c778&gt;] fc_lport_recv_req+0x12f/0x18f [libfc]
[ 1357.238450]   [&lt;ffffffffa015a6d7&gt;] fc_exch_recv+0x8ba/0x981 [libfc]
[ 1357.238450]   [&lt;ffffffffa0176d7a&gt;] fcoe_percpu_receive_thread+0x47a/0x4e2 [fcoe]
[ 1357.238450]   [&lt;ffffffff810549f1&gt;] kthread+0xb1/0xb9
[ 1357.238450]   [&lt;ffffffff814a40ec&gt;] ret_from_fork+0x7c/0xb0
[ 1357.238450] irq event stamp: 275411
[ 1357.238450] hardirqs last  enabled at (275410): [&lt;ffffffff810bb6a0&gt;] rcu_process_callbacks+0x229/0x42a
[ 1357.238450] hardirqs last disabled at (275411): [&lt;ffffffff8149c2f7&gt;] _raw_spin_lock_irqsave+0x22/0x8e
[ 1357.238450] softirqs last  enabled at (275394): [&lt;ffffffff8103d669&gt;] __do_softirq+0x246/0x26f
[ 1357.238450] softirqs last disabled at (275399): [&lt;ffffffff8103d6bb&gt;] run_ksoftirqd+0x29/0x62
[ 1357.238450]
[ 1357.238450] other info that might help us debug this:
[ 1357.238450]  Possible unsafe locking scenario:
[ 1357.238450]
[ 1357.238450]        CPU0
[ 1357.238450]        ----
[ 1357.238450]   lock(&amp;(&amp;se_tpg-&gt;session_lock)-&gt;rlock);
[ 1357.238450]   &lt;Interrupt&gt;
[ 1357.238450]     lock(&amp;(&amp;se_tpg-&gt;session_lock)-&gt;rlock);
[ 1357.238450]
[ 1357.238450]  *** DEADLOCK ***
[ 1357.238450]
[ 1357.238450] no locks held by ksoftirqd/0/3.
[ 1357.238450]
[ 1357.238450] stack backtrace:
[ 1357.238450] Pid: 3, comm: ksoftirqd/0 Tainted: G           O 3.7.0-rc7-yikvm+ #3
[ 1357.238450] Call Trace:
[ 1357.238450]  [&lt;ffffffff8149399a&gt;] print_usage_bug+0x1f5/0x206
[ 1357.238450]  [&lt;ffffffff8100da59&gt;] ? save_stack_trace+0x2c/0x49
[ 1357.238450]  [&lt;ffffffff81082aae&gt;] ? print_irq_inversion_bug.part.14+0x1ae/0x1ae
[ 1357.238450]  [&lt;ffffffff81083336&gt;] mark_lock+0x106/0x258
[ 1357.238450]  [&lt;ffffffff81084e34&gt;] __lock_acquire+0x2e7/0xe53
[ 1357.238450]  [&lt;ffffffff8102903d&gt;] ? pvclock_clocksource_read+0x48/0xb4
[ 1357.238450]  [&lt;ffffffff810ba6a3&gt;] ? rcu_process_gp_end+0xc0/0xc9
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffff81085ef1&gt;] lock_acquire+0x119/0x143
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffff8149c329&gt;] _raw_spin_lock_irqsave+0x54/0x8e
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] ? transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffffa01eacd4&gt;] transport_deregister_session+0x41/0x148 [target_core_mod]
[ 1357.238450]  [&lt;ffffffff810bb6a0&gt;] ? rcu_process_callbacks+0x229/0x42a
[ 1357.238450]  [&lt;ffffffffa018ddc5&gt;] ft_sess_rcu_free+0x17/0x24 [tcm_fc]
[ 1357.238450]  [&lt;ffffffffa018ddae&gt;] ? ft_sess_free+0x1b/0x1b [tcm_fc]
[ 1357.238450]  [&lt;ffffffff810bb6d7&gt;] rcu_process_callbacks+0x260/0x42a
[ 1357.238450]  [&lt;ffffffff8103d55d&gt;] __do_softirq+0x13a/0x26f
[ 1357.238450]  [&lt;ffffffff8149b34e&gt;] ? __schedule+0x65f/0x68e
[ 1357.238450]  [&lt;ffffffff8103d6bb&gt;] run_ksoftirqd+0x29/0x62
[ 1357.238450]  [&lt;ffffffff8105c83c&gt;] smpboot_thread_fn+0x1a5/0x1aa
[ 1357.238450]  [&lt;ffffffff8105c697&gt;] ? smpboot_unregister_percpu_thread+0x47/0x47
[ 1357.238450]  [&lt;ffffffff810549f1&gt;] kthread+0xb1/0xb9
[ 1357.238450]  [&lt;ffffffff8149b49d&gt;] ? wait_for_common+0xbb/0x10a
[ 1357.238450]  [&lt;ffffffff81054940&gt;] ? __init_kthread_worker+0x59/0x59
[ 1357.238450]  [&lt;ffffffff814a40ec&gt;] ret_from_fork+0x7c/0xb0
[ 1357.238450]  [&lt;ffffffff81054940&gt;] ? __init_kthread_worker+0x59/0x59
[ 1417.440099]  rport-2:0-0: blocked FC remote port time out: removing rport

Signed-off-by: Yi Zou &lt;yi.zou@intel.com&gt;
Cc: Open-FCoE &lt;devel@open-fcoe.org&gt;
Cc: Nicholas A. Bellinger &lt;nab@risingtidesystems.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>target: Don't return success from module_init() if setup fails</title>
<updated>2012-11-17T21:14:20+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-10-31T16:16:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f100fdf3a97be683cf57802a566cfe0cce89fc7a'/>
<id>f100fdf3a97be683cf57802a566cfe0cce89fc7a</id>
<content type='text'>
commit 0d0f9dfb31e0a6c92063e235417b42df185b3275 upstream.

If the call to core_dev_release_virtual_lun0() fails, then nothing
sets ret to anything other than 0, so even though everything is
torn down and freed, target_core_init_configfs() will seem to succeed
and the module will be loaded.  Fix this by passing the return value
on up the chain.

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 0d0f9dfb31e0a6c92063e235417b42df185b3275 upstream.

If the call to core_dev_release_virtual_lun0() fails, then nothing
sets ret to anything other than 0, so even though everything is
torn down and freed, target_core_init_configfs() will seem to succeed
and the module will be loaded.  Fix this by passing the return value
on up the chain.

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;

</pre>
</div>
</content>
</entry>
<entry>
<title>target: Fix -&gt;data_length re-assignment bug with SCSI overflow</title>
<updated>2012-10-02T16:47:23+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-08-16T22:33:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e3653afefd005d16274c9f16511530de3d511c1a'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>tcm_fc: Resolve suspicious RCU usage warnings</title>
<updated>2012-07-16T15:47:49+00:00</updated>
<author>
<name>Mark Rustad</name>
<email>mark.d.rustad@intel.com</email>
</author>
<published>2012-06-26T22:57:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e69325eb5e413816e25d3b8599f67644f4f49698'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
<entry>
<title>target: Fix 16-bit target ports for SET TARGET PORT GROUPS emulation</title>
<updated>2012-04-02T16:27:12+00:00</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2012-02-24T01:22:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=91e4c264a6f7b2de2fa5d996db9297e99bfb1006'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;

</pre>
</div>
</content>
</entry>
</feed>
