<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/target?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/target?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-02-22T21:32:29Z</updated>
<entry>
<title>target: Fix free-after-use regression in PR unregister</title>
<updated>2014-02-22T21:32:29Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2014-01-30T21:08:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e495ac8fa1a22c8f9ea21b0270248592487a2b94'/>
<id>urn:sha1:e495ac8fa1a22c8f9ea21b0270248592487a2b94</id>
<content type='text'>
commit fc09149df6e20cfbb0bb86f10899607c321a31eb upstream.

This patch addresses a &gt;= v3.11 free-after-use regression
in core_scsi3_emulate_pro_register() that was introduced
in the following commit:

commit bc118fe4c4a8cfa453491ba77c0a146a6d0e73e0
Author: Andy Grover &lt;agrover@redhat.com&gt;
Date:   Thu May 16 10:41:04 2013 -0700

    target: Further refactoring of core_scsi3_emulate_pro_register()

To avoid the free-after-use, save an type value before hand, and
only call core_scsi3_put_pr_reg() with a valid *pr_reg.

Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.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 connection reset hang with percpu_ida_alloc</title>
<updated>2014-02-13T21:50:19Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2014-01-20T03:36:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dedd6ba4c2e82766b65efbc4681647f1b8107e2e'/>
<id>urn:sha1:dedd6ba4c2e82766b65efbc4681647f1b8107e2e</id>
<content type='text'>
commit 555b270e25b0279b98083518a85f4b1da144a181 upstream.

This patch addresses a bug where connection reset would hang
indefinately once percpu_ida_alloc() was starved for tags, due
to the fact that it always assumed uninterruptible sleep mode.

So now make percpu_ida_alloc() check for signal_pending_state() for
making interruptible sleep optional, and convert iscsit_allocate_cmd()
to set TASK_INTERRUPTIBLE for GFP_KERNEL, or TASK_RUNNING for
GFP_ATOMIC.

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Kent Overstreet &lt;kmo@daterainc.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>percpu_ida: Make percpu_ida_alloc + callers accept task state bitmask</title>
<updated>2014-02-13T21:50:19Z</updated>
<author>
<name>Kent Overstreet</name>
<email>kmo@daterainc.com</email>
</author>
<published>2014-01-19T08:26:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8cf2461787d8870b637f04c3c1cc9e7b2c3ade7d'/>
<id>urn:sha1:8cf2461787d8870b637f04c3c1cc9e7b2c3ade7d</id>
<content type='text'>
commit 6f6b5d1ec56acdeab0503d2b823f6f88a0af493e upstream.

This patch changes percpu_ida_alloc() + callers to accept task state
bitmask for prepare_to_wait() for code like target/iscsi that needs
it for interruptible sleep, that is provided in a subsequent patch.

It now expects TASK_UNINTERRUPTIBLE when the caller is able to sleep
waiting for a new tag, or TASK_RUNNING when the caller cannot sleep,
and is forced to return a negative value when no tags are available.

v2 changes:
  - Include blk-mq + tcm_fc + vhost/scsi + target/iscsi changes
  - Drop signal_pending_state() call
v3 changes:
  - Only call prepare_to_wait() + finish_wait() when != TASK_RUNNING
    (PeterZ)

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Kent Overstreet &lt;kmo@daterainc.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/iscsi: Fix network portal creation race</title>
<updated>2014-02-06T19:22:22Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2014-01-25T00:18:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=268938938ee6e9be5697932dfc92c9de703216af'/>
<id>urn:sha1:268938938ee6e9be5697932dfc92c9de703216af</id>
<content type='text'>
commit ee291e63293146db64668e8d65eb35c97e8324f4 upstream.

When creating network portals rapidly, such as when restoring a
configuration, LIO's code to reuse existing portals can return a false
negative if the thread hasn't run yet and set np_thread_state to
ISCSI_NP_THREAD_ACTIVE. This causes an error in the network stack
when attempting to bind to the same address/port.

This patch sets NP_THREAD_ACTIVE before the np is placed on g_np_list,
so even if the thread hasn't run yet, iscsit_get_np will return the
existing np.

Also, convert np_lock -&gt; np_mutex + hold across adding new net portal
to g_np_list to prevent a race where two threads may attempt to create
the same network portal, resulting in one of them failing.

(nab: Add missing mutex_unlocks in iscsit_add_np failure paths)
(DanC: Fix incorrect spin_unlock -&gt; spin_unlock_bh)

Signed-off-by: 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: Pre-allocate more tags to avoid ack starvation</title>
<updated>2014-02-06T19:22:21Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2014-01-10T02:06:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0663ebb3d524621d0baf59cf70bc4d9f4b05560e'/>
<id>urn:sha1:0663ebb3d524621d0baf59cf70bc4d9f4b05560e</id>
<content type='text'>
commit 4a4caa29f1abcb14377e05d57c0793d338fb945d upstream.

This patch addresses an traditional iscsi-target fabric ack starvation
issue where iscsit_allocate_cmd() -&gt; percpu_ida_alloc_state() ends up
hitting slow path percpu-ida code, because iscsit_ack_from_expstatsn()
is expected to free ack'ed tags after tag allocation.

This is done to take into account the tags waiting to be acknowledged
and released in iscsit_ack_from_expstatsn(), but who's number are not
directly limited by the CmdSN Window queue_depth being enforced by
the target.

So that said, this patch bumps up the pre-allocated number of
per session tags to:

  (max(queue_depth, ISCSIT_MIN_TAGS) * 2) + ISCSIT_EXTRA_TAGS

for good measure to avoid the percpu_ida_alloc_state() slow path.

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/file: Update hw_max_sectors based on current block_size</title>
<updated>2014-01-09T20:25:09Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2013-12-12T20:24:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=cd3f6dea647f4d5e49f44ae919966e18b0e63ac7'/>
<id>urn:sha1:cd3f6dea647f4d5e49f44ae919966e18b0e63ac7</id>
<content type='text'>
commit 95cadace8f3959282e76ebf8b382bd0930807d2c upstream.

This patch allows FILEIO to update hw_max_sectors based on the current
max_bytes_per_io.  This is required because vfs_[writev,readv]() can accept
a maximum of 2048 iovecs per call, so the enforced hw_max_sectors really
needs to be calculated based on block_size.

This addresses a &gt;= v3.5 bug where block_size=512 was rejecting &gt; 1M
sized I/O requests, because FD_MAX_SECTORS was hardcoded to 2048 for
the block_size=4096 case.

(v2: Use max_bytes_per_io instead of -&gt;update_hw_max_sectors)

Reported-by: Henrik Goldman &lt;hg@x-formation.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 incorrect np-&gt;np_thread NULL assignment</title>
<updated>2014-01-09T20:25:09Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2013-12-11T23:45:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f0c626f9e435d788e9b8950be22a0b801ec5e5ba'/>
<id>urn:sha1:f0c626f9e435d788e9b8950be22a0b801ec5e5ba</id>
<content type='text'>
commit db6077fd0b7dd41dc6ff18329cec979379071f87 upstream.

When shutting down a target there is a race condition between
iscsit_del_np() and __iscsi_target_login_thread().
The latter sets the thread pointer to NULL, and the former
tries to issue kthread_stop() on that pointer without any
synchronization.

This patch moves the np-&gt;np_thread NULL assignment into
iscsit_del_np(), after kthread_stop() has completed. It also
removes the signal_pending() + np_state check, and only
exits when kthread_should_stop() is true.

Reported-by: Hannes Reinecke &lt;hare@suse.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-up all zero data-length CDBs with R/W_BIT set</title>
<updated>2014-01-09T20:25:09Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2013-11-25T22:53:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=253c3ef7e8f3e353b584f783cae2e4d527aaac70'/>
<id>urn:sha1:253c3ef7e8f3e353b584f783cae2e4d527aaac70</id>
<content type='text'>
commit 4454b66cb67f14c33cd70ddcf0ff4985b26324b7 upstream.

This patch changes special case handling for ISCSI_OP_SCSI_CMD
where an initiator sends a zero length Expected Data Transfer
Length (EDTL), but still sets the WRITE and/or READ flag bits
when no payload transfer is requested.

Many, many moons ago two special cases where added for an ancient
version of ESX that has long since been fixed, so instead of adding
a new special case for the reported bug with a Broadcom 57800 NIC,
go ahead and always strip off the incorrect WRITE + READ flag bits.

Also, avoid sending a reject here, as RFC-3720 does mandate this
case be handled without protocol error.

Reported-by: Witold Bazakbal &lt;865perl@wp.pl&gt;
Tested-by: Witold Bazakbal &lt;865perl@wp.pl&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 delayed Task Aborted Status (TAS) handling bug</title>
<updated>2013-12-04T19:05:37Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2013-11-13T22:39:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2db811c4fe4f4e97079591ce46dfa5f78bfb3128'/>
<id>urn:sha1:2db811c4fe4f4e97079591ce46dfa5f78bfb3128</id>
<content type='text'>
commit 29f4c090079f442ea2723d292e4e64f0b6ac1f27 upstream.

This patch fixes a bug in delayed Task Aborted Status (TAS) handling,
where transport_send_task_abort() was not returning for the case
when the se_tfo-&gt;write_pending() callback indicated that last fabric
specific WRITE PDU had not yet been received.

It also adds an explicit cmd-&gt;scsi_status = SAM_STAT_TASK_ABORTED
assignment within transport_check_aborted_status() to avoid the case
where se_tfo-&gt;queue_status() is called when the SAM_STAT_TASK_ABORTED
assignment + -&gt;queue_status() in transport_send_task_abort() does not
occur once SCF_SENT_DELAYED_TAS has been set.

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: chap auth shouldn't match username with trailing garbage</title>
<updated>2013-12-04T19:05:23Z</updated>
<author>
<name>Eric Seppanen</name>
<email>eric@purestorage.com</email>
</author>
<published>2013-11-20T22:19:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ee265ec27a5727822118b040a980730a97de4bee'/>
<id>urn:sha1:ee265ec27a5727822118b040a980730a97de4bee</id>
<content type='text'>
commit 86784c6bdeeef78eed94d298be7a8879f6a97ee2 upstream.

In iSCSI negotiations with initiator CHAP enabled, usernames with
trailing garbage are permitted, because the string comparison only
checks the strlen of the configured username.

e.g. "usernameXXXXX" will be permitted to match "username".

Just check one more byte so the trailing null char is also matched.

Signed-off-by: Eric Seppanen &lt;eric@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>
</feed>
