<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target/loopback, branch v3.2.2</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/target/loopback?h=v3.2.2</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/target/loopback?h=v3.2.2'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-12-06T06:00:53Z</updated>
<entry>
<title>target: remove the t_tasks_bidi se_cmd field</title>
<updated>2011-12-06T06:00:53Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2011-11-14T16:36:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=33c3fafc43e56a22be60ebe67bec5ba763d51010'/>
<id>urn:sha1:33c3fafc43e56a22be60ebe67bec5ba763d51010</id>
<content type='text'>
And use a SCF_BIDI flag instead.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Drop config_item_name usage in fabric TFO-&gt;free_wwn()</title>
<updated>2011-12-06T06:00:51Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-12T17:29:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6297b07cbc42eb6b53eb88fce70a4727ea230797'/>
<id>urn:sha1:6297b07cbc42eb6b53eb88fce70a4727ea230797</id>
<content type='text'>
This patch removes config_item_name() informational usage of
TFO-&gt;free_wwn() treewide in loopback, tcm_fc, ib_srpt and
tcm_vhost module code.

Using v4 target_core_fabric_configfs.c logic, a fabric call for
config_item_name() in TFO-&gt;drop_wwn() context returns NULL as
target_fabric_drop_wwn() invoking config_item_put() -&gt;
config_group_put() will release fabric_port-&gt;port_wwn.wwn_group
before the last config_item_put() -&gt; TFO-&gt;drop_wwn() is
invoked.

Reported-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Address legacy PYX_TRANSPORT_* return code breakage</title>
<updated>2011-12-06T06:00:49Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-04T09:36:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=03e98c9eb916f3f0868c1dc344dde2a60287ff72'/>
<id>urn:sha1:03e98c9eb916f3f0868c1dc344dde2a60287ff72</id>
<content type='text'>
This patch removes legacy usage of PYX_TRANSPORT_* return codes in a number
of locations and addresses cases where transport_generic_request_failure()
was returning the incorrect sense upon CHECK_CONDITION status after the
v3.1 converson to use errno return codes.

This includes the conversion of transport_generic_request_failure() to
process cmd-&gt;scsi_sense_reason and handle extra TCM_RESERVATION_CONFLICT
before calling transport_send_check_condition_and_sense() to queue up
response status.  It also drops PYX_TRANSPORT_OUT_OF_MEMORY_RESOURCES legacy
usgae, and returns TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE w/ a response
for these cases.

transport_generic_allocate_tasks(), transport_generic_new_cmd(), backend
SCF_SCSI_DATA_SG_IO_CDB -&gt;do_task(), and emulated -&gt;execute_task() have
all been updated to set se_cmd-&gt;scsi_sense_reason and return errno codes
universally upon failure.  This includes cmd-&gt;scsi_sense_reason assignment
in target_core_alua.c, target_core_pr.c and target_core_cdb.c emulation code.

Finally it updates fabric modules to remove the legacy usage, and for
TFO-&gt;new_cmd_map() callers forwards return values outside of fabric code.
iscsi-target has also been updated to remove a handful of special cases
related to the cleanup and signaling QUEUE_FULL handling w/ ft_write_pending()

(v2: Drop extra SCF_SCSI_CDB_EXCEPTION check during failure from
     transport_generic_new_cmd, and re-add missing task-&gt;task_error_status
     assignment in transport_complete_task)

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Make TFO-&gt;check_stop_free return free status</title>
<updated>2011-11-02T15:58:30Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-11-02T10:33:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=88dd9e26d6d3e743f9c7e4562b94b2ad3c2994d3'/>
<id>urn:sha1:88dd9e26d6d3e743f9c7e4562b94b2ad3c2994d3</id>
<content type='text'>
This patch converts target_core_fabric_ops-&gt;check_stop_free() usage in
transport_cmd_check_stop() and associated fabric module usage to
return '1' when the passed se_cmd has been released directly within
-&gt;check_stop_free(), or return '0' when the passed se_cmd has not
been released.

This addresses an issue where transport_cmd_finish_abort() -&gt;
transport_cmd_check_stop_to_fabric() was leaking descriptors during
LUN_RESET for modules using -&gt;check_stop_free(), but not directly
releasing se_cmd in all cases.

Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@risingtidesystems.com&gt;
</content>
</entry>
<entry>
<title>tcm_loop: Add explict read buffer memset for SCF_SCSI_CONTROL_SG_IO_CDB</title>
<updated>2011-10-26T20:42:13Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-10-24T20:35:37Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8cd79f24350826b81e16990d9e12bc878e67d385'/>
<id>urn:sha1:8cd79f24350826b81e16990d9e12bc878e67d385</id>
<content type='text'>
This patch addresses an issue with buggy userspace code sending I/O
via scsi-generic that does not explictly clear their associated read
buffers.  It adds an explict memset of the first SGL entry within
tcm_loop_new_cmd_map() for SCF_SCSI_CONTROL_SG_IO_CDB payloads that
are currently guaranteed to be a single SGL by target-core code.

This issue is a side effect of the v3.1-rc1 merge to remove the
extra memcpy between certain control CDB types using a contigious
+ cleared buffer in target-core, and performing a memcpy into the
SGL list within tcm_loop.

It was originally mainfesting itself by udev + scsi_id + scsi-generic
not properly setting up the expected /dev/disk/by-id/ symlinks because
the INQUIRY payload was containing extra bogus data preventing the
proper NAA IEEE WWN from being parsed by userspace.

Cc: Christoph Hellwig &lt;hch@lst.de&gt;
Cc: Andy Grover &lt;agrover@redhat.com&gt;
Cc: stable@kernel.org
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>loopback: Prevent uninitialized use of tl_tpg in tcm_loop_queuecommand</title>
<updated>2011-10-24T03:21:01Z</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-10-11T02:44:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0a020436d8baf412bcf5997aee7796276ea773ae'/>
<id>urn:sha1:0a020436d8baf412bcf5997aee7796276ea773ae</id>
<content type='text'>
This patch fixes a bug with tcm_loop where performing a scsi_host rescan was
causing an oops due to a received scsi_cmnd-&gt;device-&gt;id value not matching a
previously configured tcm_loop_tpg entry in tcm_loop_hba-&gt;tl_hba_tpgs[]
obtained from within tcm_loop_queuecommand() code.

This fix adds an explict check for tcm_loop_tpg-&gt;tl_hba in order to ensure
tcm_loop_make_naa_tpg() has already been invoked to initialize a given
tcm_loop_tpg entry, and also adds an explict clear of tcm_loop_tpg-&gt;tl_hba
from within the tcm_loop_drop_naa_tpg() release path.

This bug was manifesting itself with the following OOPs:

[176289.430909] BUG: unable to handle kernel NULL pointer dereference at 0000000000000090
[176289.431337] IP: [&lt;ffffffffa0395617&gt;] transport_processing_thread+0x1e3/0x794 [target_core_mod]
[176289.431399] PGD 22e9b067 PUD 23375067 PMD 0
[176289.431399] Oops: 0000 [#1] SMP
[176289.431815] CPU 1
[176289.431815] Modules linked in: tcm_loop target_core_stgt target_core_pscsi target_core_file target_core_iblock target_core_mod crc32c ib_cm ib_sa ib_mad ib_core qla2xxx scsi_tgt configfs fcoe libfcoe libfc scsi_transport_fc ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi sr_mod cdrom sd_mod ata_piix libata e1000 mptspi mptscsih mptbase [last unloaded: target_core_mod]
[176289.431815]
[176289.431815] Pid: 12339, comm: LIO_iblock Tainted: G        W   3.1.0-rc8+
[176289.431815] RIP: 0010:[&lt;ffffffffa0395617&gt;]  [&lt;ffffffffa0395617&gt;] transport_processing_thread+0x1e3/0x794 [target_core_mod]
[176289.431815] RSP: 0018:ffff880023bfbe10  EFLAGS: 00010283
[176289.431815] RAX: 0000000000000000 RBX: ffff88002d600040 RCX: ffff88002d600108
[176289.431815] RDX: ffff88000c9e50bc RSI: 0000000000000246 RDI: 0000000000000246
[176289.431815] RBP: ffff880023bfbee0 R08: ffff88002d600108 R09: 0000000000000000
[176289.431815] R10: ffff88002fc8cc80 R11: ffffffff81671b60 R12: ffff88002d600108
[176289.431815] R13: ffff88000c9e4f38 R14: ffff88000c9e50b8 R15: 0000000000000000
[176289.431815] FS:  0000000000000000(0000) GS:ffff88002fc80000(0000) knlGS:0000000000000000
[176289.431815] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[176289.431815] CR2: 0000000000000090 CR3: 000000002a33f000 CR4: 00000000000006e0
[176289.431815] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[176289.431815] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[176289.431815] Process LIO_iblock (pid: 12339, threadinfo ffff880023bfa000, task ffff88002a2e0000)
[176289.431815] Stack:
[176289.431815]  0000000000011280 0000000000000246 ffff88002a2e0000 ffff880023a58900
[176289.431815]  ffff880023bfbed0 ffff880023bfa000 ffff880023bfa000 ffff88000c9e50d0
[176289.431815]  ffff88000c9e50c0 ffff88000c9e50bc ffff880023bfa000 ffff880023bfbfd8
[176289.431815] Call Trace:
[176289.431815]  [&lt;ffffffff81056657&gt;] ? wake_up_bit+0x25/0x25
[176289.431815]  [&lt;ffffffffa0395434&gt;] ? transport_handle_cdb_direct+0x92/0x92 [target_core_mod]
[176289.431815]  [&lt;ffffffff8105619a&gt;] kthread+0x7d/0x85
[176289.431815]  [&lt;ffffffff813cbcb4&gt;] kernel_thread_helper+0x4/0x10
[176289.431815]  [&lt;ffffffff8105611d&gt;] ? kthread_worker_fn+0x16d/0x16d
[176289.431815]  [&lt;ffffffff813cbcb0&gt;] ? gs_change+0x13/0x13
[176289.431815] Code: 67 05 00 00 41 8b 84 24 4c ff ff ff ff c8 83 f8 11 0f 87 f0 04 00 00 89 c0 ff 24 c5 b0 c6 39 a0 0f 0b eb fe 48 8b 83 d8 00 00 00
[176289.431815] RIP  [&lt;ffffffffa0395617&gt;] transport_processing_thread+0x1e3/0x794 [target_core_mod]
[176289.431815]  RSP &lt;ffff880023bfbe10&gt;
[176289.431815] CR2: 0000000000000090
[176295.041004] ---[ end trace 85dc6865b23b8f3e ]---

Reported-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Have core_tmr_alloc_req() take an explicit GFP_xxx flag</title>
<updated>2011-10-24T03:20:53Z</updated>
<author>
<name>Roland Dreier</name>
<email>roland@purestorage.com</email>
</author>
<published>2011-10-06T16:56:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=dd503a5fcc0dfb8b5fd887bd967b6f431176864b'/>
<id>urn:sha1:dd503a5fcc0dfb8b5fd887bd967b6f431176864b</id>
<content type='text'>
Testing in_interrupt() to know when sleeping is allowed is not really
reliable (since eg it won't be true if the caller is holding a spinlock).
Instead have the caller tell core_tmr_alloc_req() what GFP_xxx to use;
every caller except tcm_qla2xxx can use GFP_KERNEL.

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: push session reinstatement out of transport_generic_free_cmd</title>
<updated>2011-10-24T03:20:38Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2011-09-13T21:09:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=82f1c8a4e7739eae9f1c32c2c419efdc19b8af41'/>
<id>urn:sha1:82f1c8a4e7739eae9f1c32c2c419efdc19b8af41</id>
<content type='text'>
Push session reinstatement out of transport_generic_free_cmd into the only
caller that actually needs it.  Clean up transport_generic_free_cmd a bit,
and remove the useless comment.  I'd love to add a more useful kerneldoc
comment for it, but as this point I'm still a bit confused in where it
stands in the command release stack.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Follow up core updates from AGrover and HCH (round 4)</title>
<updated>2011-07-22T09:37:48Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2011-06-08T17:36:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6708bb27bb2703da238f21f516034263348af5be'/>
<id>urn:sha1:6708bb27bb2703da238f21f516034263348af5be</id>
<content type='text'>
This patch contains the squashed version of forth round series cleanups
from Andy and Christoph following the post heavy lifting in the preceeding:
'Eliminate usage of struct se_mem' and 'Make all control CDBs scatter-gather'
changes.  This also includes a conversion of target core and the v3.0
mainline fabric modules (loopback and tcm_fc) to use pr_debug and the
CONFIG_DYNAMIC_DEBUG infrastructure!

These have been squashed into this third and final round for v3.1.

target: Remove ifdeffed code in t_g_process_write
target: Remove direct ramdisk code
target: Rename task_sg_num to task_sg_nents
target: Remove custom debug macros for pr_debug. Use pr_err().
target: Remove custom debug macros in mainline fabrics
target: Set WSNZ=1 in block limits VPD. Abort if WRITE_SAME sectors = 0
target: Remove transport do_se_mem_map callback
target: Further simplify transport_free_pages
target: Redo task allocation return value handling
target: Remove extra parentheses
target: change alloc_task call to take *cdb, not *cmd

(nab: Fix bogus struct file assignments in fd_do_readv and fd_do_writev)

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
<entry>
<title>target: Eliminate usage of struct se_mem</title>
<updated>2011-07-22T09:37:48Z</updated>
<author>
<name>Andy Grover</name>
<email>agrover@redhat.com</email>
</author>
<published>2011-07-20T19:28:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ec98f7825c6eaa4a9afb0eb518826efc8a2ed4a2'/>
<id>urn:sha1:ec98f7825c6eaa4a9afb0eb518826efc8a2ed4a2</id>
<content type='text'>
Both backstores and fabrics use arrays of struct scatterlist to describe
data buffers. However TCM used struct se_mems, basically a linked list
of scatterlist entries. We are able to simplify the code by eliminating
this intermediate data structure and just using struct scatterlist[]
throughout.

Also, moved attachment of task to cmd out of transport_generic_get_task
and into allocate_control_task and allocate_data_tasks. The reasoning
is that it's nonintuitive that get_task should automatically add it to
the cmd's task list -- it should just return an allocated, initialized
task. That's all it should do, based on the function's name, so either the
function shouldn't do it, or the name should change to encapsulate the
entire essence of what it does.

(nab: Fix compile warnings in tcm_fc, and make transport_kmap_first_data_page
 honor sg-&gt;offset for SGLs from contigious memory with TCM_Loop, and
 fix control se_cmd descriptor memory leak)

Signed-off-by: Andy Grover &lt;agrover@redhat.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
</entry>
</feed>
