<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target, branch v3.1</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/target?h=v3.1</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/target?h=v3.1'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-09-16T23:47:07Z</updated>
<entry>
<title>iscsi-target: Fix sendpage breakage with proper padding+DataDigest iovec offsets</title>
<updated>2011-09-16T23:47:07Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-09-16T23:55:47Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=40b054970afcf067896d62cd6f7e617c62665304'/>
<id>urn:sha1:40b054970afcf067896d62cd6f7e617c62665304</id>
<content type='text'>
This patch fixes a bug in the iscsit_fe_sendpage_sg() transmit codepath that
was originally introduced with the v3.1 iscsi-target merge that incorrectly
uses hardcoded cmd-&gt;iov_data_count values to determine cmd-&gt;iov_data[] offsets
for extra outgoing padding and DataDigest payload vectors.

This code is obviously incorrect for the DataDigest enabled case with sendpage
offload, and this fix ensures correct operation for padding + DataDigest,
padding only, and DataDigest only cases.  The bug was introduced during a
pre-merge change in iscsit_fe_sendpage_sg() to natively use struct scatterlist
instead of the legacy v3.0 struct se_mem logic.

Cc: Andy Grover &lt;agrover@redhat.com&gt;
Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>iscsi-target: Disable markers + remove dangerous local scope array usage</title>
<updated>2011-09-16T19:37:18Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-09-16T08:44:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2ff017f5b4299e24a7f22d9a336dd162bf52bb54'/>
<id>urn:sha1:2ff017f5b4299e24a7f22d9a336dd162bf52bb54</id>
<content type='text'>
This patch makes iscsi-target explictly disable OFMarker=Yes and IFMarker=yes
parameter key usage during iscsi login by setting IFMarkInt_Reject and
OFMarkInt_Reject values in iscsi_enforce_integrity_rules() to effectively
disable iscsi marker usage.  With this patch, an initiator proposer asking
to enable either marker parameter keys will be issued a 'No' response, and
the target sets OFMarkInt + IFMarkInt parameter key response to 'Irrelevant'.

With markers disabled during iscsi login, this patch removes the problematic
on-stack local-scope array for marker intervals in iscsit_do_rx_data() +
iscsit_do_tx_data(), and other related marker code in iscsi_target_util.c.
This fixes a potentional stack smashing scenario with small range markers
enabled and a large MRDSL as reported by DanC here:

[bug report] target: stack can be smashed
http://www.spinics.net/lists/target-devel/msg00453.html

Reported-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Skip non hex characters for VPD=0x83 NAA IEEE Registered Extended</title>
<updated>2011-09-16T19:36:56Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-09-16T08:31:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=784eb99ebad91db4c8c231c4b17f203147ab827b'/>
<id>urn:sha1:784eb99ebad91db4c8c231c4b17f203147ab827b</id>
<content type='text'>
This patch adds target_parse_naa_6h_vendor_specific() to address a bug where the
conversion of PRODUCT SERIAL NUMBER to use hex2bin() in target_emulate_evpd_83()
was not doing proper isxdigit() checking.  This conversion of the vpd_unit_serial
configifs attribute is done while generating a VPD=0x83 NAA IEEE Registered
Extended DESIGNATOR format's 100 bits of unique VENDOR SPECIFIC IDENTIFIER +
VENDOR SPECIFIC IDENTIFIER EXTENSION area.

This patch allows vpd_unit_serial (VPD=0x80) and the T10 Vendor ID DESIGNATOR
format (VPD=0x83) to continue to use free-form variable length ASCII values,
and now skips any non hex characters for fixed length NAA IEEE Registered Extended
DESIGNATOR format (VPD=0x83) requring the binary conversion.

This was originally reported by Martin after the v3.1-rc1 change to use hex2bin()
in commit 11650b859681e03fdbf26277fcfc5f1f62186703 where the use of non hex
characters in vpd_unit_serial generated different values than the original
v3.0 internal hex -&gt; binary code.  This v3.1 change caused a problem with
filesystems who write a NAA DESIGNATOR onto it's ondisk metadata, and this patch
will (again) change existing values to ensure that non hex characters are not
included in the fixed length NAA DESIGNATOR.

Note this patch still expects vpd_unit_serial to be set via existing userspace
methods of uuid generation, and does not do strict formatting via configfs input.

The original bug report and thread can be found here:

NAA breakage
http://www.spinics.net/lists/target-devel/msg00477.html

The v3.1-rc1 formatting of VPD=0x83 w/o this patch:

VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 20
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 6, IEEE Company_id: 0x1405
      Vendor Specific Identifier: 0xffde35ebf
      Vendor Specific Identifier Extension: 0x3092f498ffa820f9
      [0x6001405ffde35ebf3092f498ffa820f9]
  Designation descriptor number 2, descriptor length: 56
    designator_type: T10 vendor identification,  code_set: ASCII
    associated with the addressed logical unit
      vendor id: LIO-ORG
      vendor specific: IBLOCK:ffde35ec-3092-4980-a820-917636ca54f1

The v3.1-final formatting of VPD=0x83 w/ this patch:

VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 20
    designator_type: NAA,  code_set: Binary
    associated with the addressed logical unit
      NAA 6, IEEE Company_id: 0x1405
      Vendor Specific Identifier: 0xffde35ec3
      Vendor Specific Identifier Extension: 0x924980a82091763
      [0x6001405ffde35ec30924980a82091763]
  Designation descriptor number 2, descriptor length: 56
    designator_type: T10 vendor identification,  code_set: ASCII
    associated with the addressed logical unit
      vendor id: LIO-ORG
      vendor specific: IBLOCK:ffde35ec-3092-4980-a820-917636ca54f1

(v2: Fix parsing code to dereference + check for string terminator instead
     of null pointer to ensure a zeroed payload for vpd_unit_serial less
     than 100 bits of NAA DESIGNATOR VENDOR SPECIFIC area.  Also, remove
     the unnecessary bitwise assignment)

Reported-by: Martin Svec &lt;martin.svec@zoner.cz&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_fc: Work queue based approach instead of managing own thread and event based mechanism</title>
<updated>2011-09-16T09:50:09Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2011-08-26T16:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=58fc73d10f3e92bfcd1e9a8391eb3e49b68df8e5'/>
<id>urn:sha1:58fc73d10f3e92bfcd1e9a8391eb3e49b68df8e5</id>
<content type='text'>
Problem: Changed from wake_up_interruptible -&gt; wake_up_process and
wait_event_interruptible-&gt; schedule_timeout_interruptible broke the FCoE
target.  Earlier approach of wake_up_interruptible was also looking at
'queue_cnt' which is not necessary, because it increment of 'queue_cnt'
with wake_up_inetrriptible / waker_up_process introduces race condition.

Fix: Instead of fixing the code which used wake_up_process and remove
'queue_cnt', using work_queue based approach is cleaner and acheives
same result. As well, work queue based approach has less programming
overhead and OS manages threads which processes work queues.

This patch is developed by Christoph Hellwig and reviwed+validated by
Kiran Patil.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Kiran Patil &lt;kiran.patil@intel.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_fc: Invalidation of DDP context for FCoE target in error conditions</title>
<updated>2011-09-16T09:29:27Z</updated>
<author>
<name>Kiran Patil</name>
<email>kiran.patil@intel.com</email>
</author>
<published>2011-08-26T16:25:25Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=079587b4eb4d3b78a4d65d142f662aa9d7eedab4'/>
<id>urn:sha1:079587b4eb4d3b78a4d65d142f662aa9d7eedab4</id>
<content type='text'>
Problem: HW DDP context wasn;t invalidated in case of ABORTS, etc...
This leads to the problem where memory pages which are used for DDP
as user descriptor could get reused for some other purpose (such as to
satisfy new memory allocation request either by kernel or user mode threads)
and since HW DDP context was not invalidated, HW continue to write to
those pages, hence causing memory corruption.

Fix: Either on incoming ABORTS or due to exchange time out, allowed the
target to cleanup HW DDP context if it was setup for respective ft_cmd.
Added new function to perform this cleanup, furthur it can be enhanced
for other cleanup activity.

Additinal Notes: To avoid calling ddp_done from multiple places, composed
the functionality in helper function "ft_invl_hw_context" and it is being
called from multiple places. Cleaned up code in function "ft_recv_write_data"
w.r.t DDP.

Signed-off-by: Kiran Patil &lt;kiran.patil@intel.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Fix race between multiple invocations of target_qf_do_work()</title>
<updated>2011-09-16T09:29:20Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-08-28T04:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcac364a24c894c4cf8cf219b7863c192cd34079'/>
<id>urn:sha1:bcac364a24c894c4cf8cf219b7863c192cd34079</id>
<content type='text'>
When work is scheduled with schedule_work(), the work can end up
running on multiple CPUs at the same time -- this happens if
the work is already running on one CPU and schedule_work() is called
on another CPU.  This leads to list corruption with target_qf_do_work(),
which is roughly doing:

	spin_lock(...);
	list_for_each_entry_safe(...) {
		list_del(...);
		spin_unlock(...);

		// do stuff

		spin_lock(...);
	}

With multiple CPUs running this code, one CPU can end up deleting the
list entry that the other CPU is about to work on.

Fix this by splicing the list entries onto a local list and then
operating on that in the work function.  This way, each invocation of
target_qf_do_work() operates on its own local list and so multiple
invocations don't corrupt each other's list.  This also avoids dropping
and reacquiring the lock for each list entry.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Convert acl_node_lock to be IRQ-disabling</title>
<updated>2011-08-22T19:28:36Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-08-16T16:40:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=28638887f351d11867562322b7abaa014dd5528a'/>
<id>urn:sha1:28638887f351d11867562322b7abaa014dd5528a</id>
<content type='text'>
With qla2xxx, acl_node_lock is taken inside qla2xxx's hardware_lock,
which is taken in hardirq context.  This means acl_node_lock must become
an IRQ-disabling lock; in particular this fixes lockdep warnings along
the lines of

    ======================================================
    [ INFO: HARDIRQ-safe -&gt; HARDIRQ-unsafe lock order detected ]

     (&amp;(&amp;se_tpg-&gt;acl_node_lock)-&gt;rlock){+.....}, at: [&lt;ffffffffa026f872&gt;] transport_deregister_session+0x92/0x140 [target_core_mod]

    and this task is already holding:
     (&amp;(&amp;ha-&gt;hardware_lock)-&gt;rlock){-.-...}, at: [&lt;ffffffffa017c5e7&gt;] qla_tgt_stop_phase1+0x57/0x2c0 [qla2xxx]
    which would create a new lock dependency:
     (&amp;(&amp;ha-&gt;hardware_lock)-&gt;rlock){-.-...} -&gt; (&amp;(&amp;se_tpg-&gt;acl_node_lock)-&gt;rlock){+.....}

    but this new dependency connects a HARDIRQ-irq-safe lock:
     (&amp;(&amp;ha-&gt;hardware_lock)-&gt;rlock){-.-...}

    to a HARDIRQ-irq-unsafe lock:
     (&amp;(&amp;se_tpg-&gt;acl_node_lock)-&gt;rlock){+.....}

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Make locking in transport_deregister_session() IRQ safe</title>
<updated>2011-08-22T19:26:33Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-08-12T23:01:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e63a8e1933a2218cf801e46dd01bd8cca4a555ec'/>
<id>urn:sha1:e63a8e1933a2218cf801e46dd01bd8cca4a555ec</id>
<content type='text'>
At least the tcm_qla2xxx fabric driver calls into transport_deregister_session()
while holding an IRQ-disabled spinlock, so the inner locking needs to
use spin_lock_irqsave() instead of spin_lock_bh().

This fixes warnings seen with tcm_qla2xxx like:

    WARNING: at kernel/softirq.c:159 local_bh_enable_ip+0x98/0xb0()
    Call Trace:
     [&lt;ffffffff8104e65f&gt;] warn_slowpath_common+0x7f/0xc0
     [&lt;ffffffff8104e6ba&gt;] warn_slowpath_null+0x1a/0x20
     [&lt;ffffffff81055368&gt;] local_bh_enable_ip+0x98/0xb0
     [&lt;ffffffff814d5284&gt;] _raw_spin_unlock_bh+0x14/0x20
     [&lt;ffffffffa027b7f6&gt;] transport_deregister_session+0x96/0x180 [target_core_mod]
     [&lt;ffffffffa00f7731&gt;] tcm_qla2xxx_free_session+0xd1/0x170 [tcm_qla2xxx]
     [&lt;ffffffffa01b9173&gt;] qla_tgt_sess_put+0xc3/0x140 [qla2xxx]
     [&lt;ffffffffa01bf40f&gt;] qla_tgt_stop_phase1+0x8f/0x2c0 [qla2xxx]
     [&lt;ffffffffa00f735e&gt;] tcm_qla2xxx_tpg_store_enable+0x6e/0xd0 [tcm_qla2xxx]
     [&lt;ffffffffa026ca29&gt;] target_fabric_tpg_attr_store+0x39/0x40 [target_core_mod]
     [&lt;ffffffffa00a575d&gt;] configfs_write_file+0xbd/0x120 [configfs]
     [&lt;ffffffff811464a6&gt;] vfs_write+0xc6/0x180
     [&lt;ffffffff811467c1&gt;] sys_write+0x51/0x90
     [&lt;ffffffff814dd382&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>tcm_fc: init/exit functions should not be protected by "#ifdef MODULE"</title>
<updated>2011-08-22T19:26:32Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-08-12T17:16:52Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4e0f05297ff615a9a4e269da301ff77f660a3ab0'/>
<id>urn:sha1:4e0f05297ff615a9a4e269da301ff77f660a3ab0</id>
<content type='text'>
There's no need for the #ifdef protection when building into the kernel,
and in fact we need the module_init() for the initialization function to
be called.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Print subpage too for unhandled MODE SENSE pages</title>
<updated>2011-08-22T19:26:31Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-08-12T17:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f15ea5780d08e4c96930c0d607d05e480ec588c8'/>
<id>urn:sha1:f15ea5780d08e4c96930c0d607d05e480ec588c8</id>
<content type='text'>
Make a log message more useful by printing both the page and subpage
that an initiator is requesting.

Signed-off-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
