<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/target/loopback, branch v3.3</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/target/loopback?h=v3.3</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/target/loopback?h=v3.3'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2011-12-14T11:28:11Z</updated>
<entry>
<title>tcm_loop: bump max_sectors</title>
<updated>2011-12-14T11:28:11Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2011-11-29T08:20:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=2e88efd3aaafa0df05593cdfa5fd17afe922781d'/>
<id>urn:sha1:2e88efd3aaafa0df05593cdfa5fd17afe922781d</id>
<content type='text'>
There is not reason to artifically limit max_sectors in tcm_loop, set
it to UINT_MAX to allow stressing the large I/O handling in the target
core using the loopback driver.  Also remove various superflous defines
hiding the values set in the host template.

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: remove useless casts</title>
<updated>2011-12-14T11:28:07Z</updated>
<author>
<name>Jörn Engel</name>
<email>joern@logfs.org</email>
</author>
<published>2011-11-24T01:05:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8359cf43b9dccddeebb0d247146719a14ce6371a'/>
<id>urn:sha1:8359cf43b9dccddeebb0d247146719a14ce6371a</id>
<content type='text'>
A reader should spend an extra moment whenever noticing a cast,
because either something special is going on that deserves extra
attention or, as is all too often the case, the code is wrong.

These casts, afaics, have all been useless.  They cast a foo* to a
foo*, cast a void* to the assigned type, cast a foo* to void*, before
assigning it to a void* variable, etc.

In a few cases I also removed an additional &amp;...[0], which is equally
useless.

Lastly I added three FIXMEs where, to the best of my judgement, the
code appears to have a bug.  It would be good if someone could check
these.

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>target: header reshuffle, part2</title>
<updated>2011-12-14T11:26:05Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@infradead.org</email>
</author>
<published>2011-11-16T14:46:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c4795fb20edf2fe2c862c8fe9f8b681edeb79ac1'/>
<id>urn:sha1:c4795fb20edf2fe2c862c8fe9f8b681edeb79ac1</id>
<content type='text'>
This reorganized the headers under include/target into:

 - target_core_base.h stays as is with all target-wide data stuctures and defines
 - target_core_backend.h contains the whole interface to I/O backends
 - target_core_fabric.h contains the whole interface to fabric modules

Except for those only the various configfs macro headers stay around.

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: 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>
</feed>
