<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/target/target_core_device.c, branch v3.0</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>target: Fix incorrect strlen() NULL terminator checks</title>
<updated>2011-06-24T00:08:11+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2011-06-15T17:03:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=60d645a4e9e7e7ddc20e534fea82aa4e6947f911'/>
<id>60d645a4e9e7e7ddc20e534fea82aa4e6947f911</id>
<content type='text'>
This patch fixes a number of cases in target core using an incorrectly

	if (strlen(foo) &gt; SOME_MAX_SIZE)

As strlen() returns the number of characters in the string not counting
the NULL character at the end.  So if you do something like:

        char buf[10];

        if (strlen("0123456789") &gt; 10)
                return -ETOOLONG;
        snprintf(buf, 10, "0123456789");
        printf("%s\n", buf);

then the last "9" gets chopped off and only "012345678" is printed.

Plus I threw in one small related cleanup.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes a number of cases in target core using an incorrectly

	if (strlen(foo) &gt; SOME_MAX_SIZE)

As strlen() returns the number of characters in the string not counting
the NULL character at the end.  So if you do something like:

        char buf[10];

        if (strlen("0123456789") &gt; 10)
                return -ETOOLONG;
        snprintf(buf, 10, "0123456789");
        printf("%s\n", buf);

then the last "9" gets chopped off and only "012345678" is printed.

Plus I threw in one small related cleanup.

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>target: Fix transport_get_lun_for_tmr failure cases</title>
<updated>2011-06-23T23:59:45+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-06-23T23:48:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=7fd29aa920273b70be50c14c4b7e2213fb6623ce'/>
<id>7fd29aa920273b70be50c14c4b7e2213fb6623ce</id>
<content type='text'>
This patch fixes two possible NULL pointer dereferences in target v4.0
code where se_tmr release path in core_tmr_release_req() can OOPs upon
transport_get_lun_for_tmr() failure by attempting to access se_device or
se_tmr-&gt;tmr_list without a valid member of se_device-&gt;tmr_list during
transport_free_se_cmd() release.  This patch moves the se_tmr-&gt;tmr_dev
pointer assignment in transport_get_lun_for_tmr() until after possible
-ENODEV failures during unpacked_lun lookup.

This addresses an OOPs originally reported with LIO v4.1 upstream on
.39 code here:

    TARGET_CORE[qla2xxx]: Detected NON_EXISTENT_LUN Access for 0x00000000
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000550
    IP: [&lt;ffffffff81035ec4&gt;] __ticket_spin_trylock+0x4/0x20
    PGD 0
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/devices/system/cpu/cpu23/cache/index2/shared_cpu_map
    CPU 1
    Modules linked in: netconsole target_core_pscsi target_core_file
tcm_qla2xxx target_core_iblock tcm_loop target_core_mod configfs
ipmi_devintf ipmi_si ipmi_msghandler serio_raw i7core_edac ioatdma dca
edac_core ps_bdrv ses enclosure usbhid usb_storage ahci qla2xxx hid
uas e1000e mpt2sas libahci mlx4_core scsi_transport_fc
scsi_transport_sas raid_class scsi_tgt [last unloaded: netconsole]

    Pid: 0, comm: kworker/0:0 Tainted: G        W   2.6.39+ #1 Xyratex Storage Server
    RIP: 0010:[&lt;ffffffff81035ec4&gt;] [&lt;ffffffff81035ec4&gt;]__ticket_spin_trylock+0x4/0x20
    RSP: 0018:ffff88063e803c08  EFLAGS: 00010286
    RAX: ffff880619ab45e0 RBX: 0000000000000550 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000550
    RBP: ffff88063e803c08 R08: 0000000000000002 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000568
    R13: 0000000000000001 R14: 0000000000000000 R15: ffff88060cd96a20
    FS:  0000000000000000(0000) GS:ffff88063e800000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000550 CR3: 0000000001a03000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process kworker/0:0 (pid: 0, threadinfo ffff880619ab8000, task ffff880619ab45e0)
    Stack:
     ffff88063e803c28 ffffffff812cf039 0000000000000550 0000000000000568
     ffff88063e803c58 ffffffff8157071e ffffffffa028a1dc ffff88060f7e4600
     0000000000000550 ffff880616961480 ffff88063e803c78 ffffffffa028a1dc
    Call Trace:
&lt;IRQ&gt;
     [&lt;ffffffff812cf039&gt;] do_raw_spin_trylock+0x19/0x50
     [&lt;ffffffff8157071e&gt;] _raw_spin_lock+0x3e/0x70
     [&lt;ffffffffa028a1dc&gt;] ? core_tmr_release_req+0x2c/0x60 [target_core_mod]
     [&lt;ffffffffa028a1dc&gt;] core_tmr_release_req+0x2c/0x60 [target_core_mod]
     [&lt;ffffffffa028d0d2&gt;] transport_free_se_cmd+0x22/0x50 [target_core_mod]
     [&lt;ffffffffa028d120&gt;] transport_release_cmd_to_pool+0x20/0x40 [target_core_mod]
     [&lt;ffffffffa028e525&gt;] transport_generic_free_cmd+0xa5/0xb0 [target_core_mod]
     [&lt;ffffffffa0147cc4&gt;] tcm_qla2xxx_handle_tmr+0xc4/0xd0 [tcm_qla2xxx]
     [&lt;ffffffffa0191ba3&gt;] __qla24xx_handle_abts+0xd3/0x150 [qla2xxx]
     [&lt;ffffffffa0197651&gt;] qla_tgt_response_pkt+0x171/0x520 [qla2xxx]
     [&lt;ffffffffa0197a2d&gt;] qla_tgt_response_pkt_all_vps+0x2d/0x220 [qla2xxx]
     [&lt;ffffffffa0171dd3&gt;] qla24xx_process_response_queue+0x1a3/0x670 [qla2xxx]
     [&lt;ffffffffa0196281&gt;] ? qla24xx_atio_pkt+0x81/0x120 [qla2xxx]
     [&lt;ffffffffa0174025&gt;] ? qla24xx_msix_default+0x45/0x2a0 [qla2xxx]
     [&lt;ffffffffa0174198&gt;] qla24xx_msix_default+0x1b8/0x2a0 [qla2xxx]
     [&lt;ffffffff810dadb4&gt;] handle_irq_event_percpu+0x54/0x210
     [&lt;ffffffff810dafb8&gt;] handle_irq_event+0x48/0x70
     [&lt;ffffffff810dd5ee&gt;] ? handle_edge_irq+0x1e/0x110
     [&lt;ffffffff810dd647&gt;] handle_edge_irq+0x77/0x110
     [&lt;ffffffff8100d362&gt;] handle_irq+0x22/0x40
     [&lt;ffffffff8157b28d&gt;] do_IRQ+0x5d/0xe0
     [&lt;ffffffff81571413&gt;] common_interrupt+0x13/0x13
&lt;EOI&gt;
     [&lt;ffffffff813003f7&gt;] ? intel_idle+0xd7/0x130
     [&lt;ffffffff813003f0&gt;] ? intel_idle+0xd0/0x130
     [&lt;ffffffff8144832b&gt;] cpuidle_idle_call+0xab/0x1c0
     [&lt;ffffffff8100a26b&gt;] cpu_idle+0xab/0xf0
     [&lt;ffffffff81566c59&gt;] start_secondary+0x1cb/0x1d2

Reported-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes two possible NULL pointer dereferences in target v4.0
code where se_tmr release path in core_tmr_release_req() can OOPs upon
transport_get_lun_for_tmr() failure by attempting to access se_device or
se_tmr-&gt;tmr_list without a valid member of se_device-&gt;tmr_list during
transport_free_se_cmd() release.  This patch moves the se_tmr-&gt;tmr_dev
pointer assignment in transport_get_lun_for_tmr() until after possible
-ENODEV failures during unpacked_lun lookup.

This addresses an OOPs originally reported with LIO v4.1 upstream on
.39 code here:

    TARGET_CORE[qla2xxx]: Detected NON_EXISTENT_LUN Access for 0x00000000
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000550
    IP: [&lt;ffffffff81035ec4&gt;] __ticket_spin_trylock+0x4/0x20
    PGD 0
    Oops: 0000 [#1] SMP
    last sysfs file: /sys/devices/system/cpu/cpu23/cache/index2/shared_cpu_map
    CPU 1
    Modules linked in: netconsole target_core_pscsi target_core_file
tcm_qla2xxx target_core_iblock tcm_loop target_core_mod configfs
ipmi_devintf ipmi_si ipmi_msghandler serio_raw i7core_edac ioatdma dca
edac_core ps_bdrv ses enclosure usbhid usb_storage ahci qla2xxx hid
uas e1000e mpt2sas libahci mlx4_core scsi_transport_fc
scsi_transport_sas raid_class scsi_tgt [last unloaded: netconsole]

    Pid: 0, comm: kworker/0:0 Tainted: G        W   2.6.39+ #1 Xyratex Storage Server
    RIP: 0010:[&lt;ffffffff81035ec4&gt;] [&lt;ffffffff81035ec4&gt;]__ticket_spin_trylock+0x4/0x20
    RSP: 0018:ffff88063e803c08  EFLAGS: 00010286
    RAX: ffff880619ab45e0 RBX: 0000000000000550 RCX: 0000000000000000
    RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000550
    RBP: ffff88063e803c08 R08: 0000000000000002 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000568
    R13: 0000000000000001 R14: 0000000000000000 R15: ffff88060cd96a20
    FS:  0000000000000000(0000) GS:ffff88063e800000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: 0000000000000550 CR3: 0000000001a03000 CR4: 00000000000006e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process kworker/0:0 (pid: 0, threadinfo ffff880619ab8000, task ffff880619ab45e0)
    Stack:
     ffff88063e803c28 ffffffff812cf039 0000000000000550 0000000000000568
     ffff88063e803c58 ffffffff8157071e ffffffffa028a1dc ffff88060f7e4600
     0000000000000550 ffff880616961480 ffff88063e803c78 ffffffffa028a1dc
    Call Trace:
&lt;IRQ&gt;
     [&lt;ffffffff812cf039&gt;] do_raw_spin_trylock+0x19/0x50
     [&lt;ffffffff8157071e&gt;] _raw_spin_lock+0x3e/0x70
     [&lt;ffffffffa028a1dc&gt;] ? core_tmr_release_req+0x2c/0x60 [target_core_mod]
     [&lt;ffffffffa028a1dc&gt;] core_tmr_release_req+0x2c/0x60 [target_core_mod]
     [&lt;ffffffffa028d0d2&gt;] transport_free_se_cmd+0x22/0x50 [target_core_mod]
     [&lt;ffffffffa028d120&gt;] transport_release_cmd_to_pool+0x20/0x40 [target_core_mod]
     [&lt;ffffffffa028e525&gt;] transport_generic_free_cmd+0xa5/0xb0 [target_core_mod]
     [&lt;ffffffffa0147cc4&gt;] tcm_qla2xxx_handle_tmr+0xc4/0xd0 [tcm_qla2xxx]
     [&lt;ffffffffa0191ba3&gt;] __qla24xx_handle_abts+0xd3/0x150 [qla2xxx]
     [&lt;ffffffffa0197651&gt;] qla_tgt_response_pkt+0x171/0x520 [qla2xxx]
     [&lt;ffffffffa0197a2d&gt;] qla_tgt_response_pkt_all_vps+0x2d/0x220 [qla2xxx]
     [&lt;ffffffffa0171dd3&gt;] qla24xx_process_response_queue+0x1a3/0x670 [qla2xxx]
     [&lt;ffffffffa0196281&gt;] ? qla24xx_atio_pkt+0x81/0x120 [qla2xxx]
     [&lt;ffffffffa0174025&gt;] ? qla24xx_msix_default+0x45/0x2a0 [qla2xxx]
     [&lt;ffffffffa0174198&gt;] qla24xx_msix_default+0x1b8/0x2a0 [qla2xxx]
     [&lt;ffffffff810dadb4&gt;] handle_irq_event_percpu+0x54/0x210
     [&lt;ffffffff810dafb8&gt;] handle_irq_event+0x48/0x70
     [&lt;ffffffff810dd5ee&gt;] ? handle_edge_irq+0x1e/0x110
     [&lt;ffffffff810dd647&gt;] handle_edge_irq+0x77/0x110
     [&lt;ffffffff8100d362&gt;] handle_irq+0x22/0x40
     [&lt;ffffffff8157b28d&gt;] do_IRQ+0x5d/0xe0
     [&lt;ffffffff81571413&gt;] common_interrupt+0x13/0x13
&lt;EOI&gt;
     [&lt;ffffffff813003f7&gt;] ? intel_idle+0xd7/0x130
     [&lt;ffffffff813003f0&gt;] ? intel_idle+0xd0/0x130
     [&lt;ffffffff8144832b&gt;] cpuidle_idle_call+0xab/0x1c0
     [&lt;ffffffff8100a26b&gt;] cpu_idle+0xab/0xf0
     [&lt;ffffffff81566c59&gt;] start_secondary+0x1cb/0x1d2

Reported-by: Roland Dreier &lt;roland@purestorage.com&gt;
Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] target: Convert REPORT_LUNs to use int_to_scsilun</title>
<updated>2011-05-27T11:49:43+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-05-20T03:19:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1078da163fd2c1d3cba76cd4018e897a4f98efc5'/>
<id>1078da163fd2c1d3cba76cd4018e897a4f98efc5</id>
<content type='text'>
This patch converts transport_core_report_lun_response() to use
drivers/scsi/scsi_scan.c:int_to_scsilun instead of using the
struct target_core_fabric_ops-&gt;pack_lun() fabric provided API vector.

It also removes the tfo-&gt;pack_lun check from target_fabric_tf_ops_check()
and removes from struct target_core_fabric_ops-&gt;pack_lun() from
target_core_fabric_ops.h, and the following mainline scsi-misc fabric
modules:

*) tcm_loop: Drop tcm_loop_pack_lun() usage
*) tcm_fc: Drop ft_pack_lun() usage

Reported-by: Mike Christie &lt;michaelc@cs.wisc.edu&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;jbottomley@parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch converts transport_core_report_lun_response() to use
drivers/scsi/scsi_scan.c:int_to_scsilun instead of using the
struct target_core_fabric_ops-&gt;pack_lun() fabric provided API vector.

It also removes the tfo-&gt;pack_lun check from target_fabric_tf_ops_check()
and removes from struct target_core_fabric_ops-&gt;pack_lun() from
target_core_fabric_ops.h, and the following mainline scsi-misc fabric
modules:

*) tcm_loop: Drop tcm_loop_pack_lun() usage
*) tcm_fc: Drop ft_pack_lun() usage

Reported-by: Mike Christie &lt;michaelc@cs.wisc.edu&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;jbottomley@parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] target: Fix interrupt context bug with stats_lock and core_tmr_alloc_req</title>
<updated>2011-05-27T11:49:25+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-05-20T03:19:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1e7de68c57daf75ec4b721f101f88cccf029e38c'/>
<id>1e7de68c57daf75ec4b721f101f88cccf029e38c</id>
<content type='text'>
This patch fixes two bugs wrt to the interrupt context usage of target
core with HW target mode drivers.  It first converts the usage of struct
se_device-&gt;stats_lock in transport_get_lun_for_cmd() and core_tmr_lun_reset()
to properly use spin_lock_irq() to address an BUG with CONFIG_LOCKDEP_SUPPORT=y
enabled.

This patch also adds a 'in_interrupt()' check to allow GFP_ATOMIC usage from
core_tmr_alloc_req() to fix a 'sleeping in interrupt context' BUG with HW
target fabrics that require this logic to function.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Cc: stable@kernel.org
Signed-off-by: James Bottomley &lt;jbottomley@parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes two bugs wrt to the interrupt context usage of target
core with HW target mode drivers.  It first converts the usage of struct
se_device-&gt;stats_lock in transport_get_lun_for_cmd() and core_tmr_lun_reset()
to properly use spin_lock_irq() to address an BUG with CONFIG_LOCKDEP_SUPPORT=y
enabled.

This patch also adds a 'in_interrupt()' check to allow GFP_ATOMIC usage from
core_tmr_alloc_req() to fix a 'sleeping in interrupt context' BUG with HW
target fabrics that require this logic to function.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Cc: stable@kernel.org
Signed-off-by: James Bottomley &lt;jbottomley@parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23+00:00</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2011-03-31T01:57:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] target: Minor sparse warning fixes and annotations</title>
<updated>2011-03-23T16:36:29+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>error27@gmail.com</email>
</author>
<published>2011-03-14T11:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5dd7ed2e811d5cd12f31fb7f0c5ad0107d494a12'/>
<id>5dd7ed2e811d5cd12f31fb7f0c5ad0107d494a12</id>
<content type='text'>
This patch addresses the majority of sparse warnings and adds
proper locking annotations.  It also fixes the dubious one-bit signed
bitfield, for which the signed one-bit types can be 0 or -1 which can
cause a problem if someone ever checks if (foo-&gt;lu_gp_assoc == 1).
The current code is fine because everyone just checks zero vs non-zero.
But Sparse complains about it so lets change it.  The warnings look like
this:

include/target/target_core_base.h:228:26: error: dubious one-bit signed bitfield

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Fubo Chen &lt;fubo.chen@gmail.com&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch addresses the majority of sparse warnings and adds
proper locking annotations.  It also fixes the dubious one-bit signed
bitfield, for which the signed one-bit types can be 0 or -1 which can
cause a problem if someone ever checks if (foo-&gt;lu_gp_assoc == 1).
The current code is fine because everyone just checks zero vs non-zero.
But Sparse complains about it so lets change it.  The warnings look like
this:

include/target/target_core_base.h:228:26: error: dubious one-bit signed bitfield

Signed-off-by: Dan Carpenter &lt;error27@gmail.com&gt;
Signed-off-by: Fubo Chen &lt;fubo.chen@gmail.com&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] target: Remove unnecessary hba_dev_list walk and se_clear_dev_ports legacy code</title>
<updated>2011-03-23T16:36:27+00:00</updated>
<author>
<name>Fubo Chen</name>
<email>fubo.chen@gmail.com</email>
</author>
<published>2011-03-14T11:06:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=05aea6e7e497ab418239ae54fe5966d52cbd8550'/>
<id>05aea6e7e497ab418239ae54fe5966d52cbd8550</id>
<content type='text'>
This patch removes a legacy struct se_hba-&gt;hba_dev_list -&gt; se_release_device_for_hba()
list walk in core_delete_hba(), which is no longer required while using configfs
VFS level parent/child struct config_group dependency referencing.  The reason
is because any struct se_hba-&gt;hba_dev_list-&gt; struct se_device members are going
to have to be released via:

	rmdir /sys/kernel/config/target/core/$HBA/*

before rmdir release of struct se_hba via target_core_configfs.c:
target_core_call_delhbafromtarget() -&gt; core_delete_hba()

	rmdir /sys/kernel/config/target/core/$HBA

to release struct se_hba in core_delete_hba().

This patch also removes the legacy se_clear_dev_ports() function, which is
left-over pre-configfs shutdown logic for when se_free_virtual_device()
was responsible for walking struct se_device-&gt;dev_sep_list and calling
core_dev_del_lun() for each individual active struct se_port-&gt;se_lun.

The reason this can be removed is because all struct se_device-&gt;dev_sep_list
-&gt; struct se_port communication is done via configfs symlinks, which
means that an target fabric module's endpoints containg active struct
se_port(s) will have to be released via target_core_fabric_configfs.c:
target_fabric_port_unlink() via:

	unlink /sys/kernel/config/target/$FABRIC_MOD/$ENDPOINT/tpgt_$TPGT/lun/lun_$LUN_ID/&lt;symlink&gt;

before rmdir release of struct se_device in target_core_configfs.c:
target_core_drop_subdev() -&gt; se_free_virtual_device() can happen via:

	rmdir /sys/kernel/config/target/core/$HBA/*

to release struct se_subsystem_dev in target_core_drop_subdev()

Reported-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Reported-by: Fubo Chen &lt;fubo.chen@gmail.com&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes a legacy struct se_hba-&gt;hba_dev_list -&gt; se_release_device_for_hba()
list walk in core_delete_hba(), which is no longer required while using configfs
VFS level parent/child struct config_group dependency referencing.  The reason
is because any struct se_hba-&gt;hba_dev_list-&gt; struct se_device members are going
to have to be released via:

	rmdir /sys/kernel/config/target/core/$HBA/*

before rmdir release of struct se_hba via target_core_configfs.c:
target_core_call_delhbafromtarget() -&gt; core_delete_hba()

	rmdir /sys/kernel/config/target/core/$HBA

to release struct se_hba in core_delete_hba().

This patch also removes the legacy se_clear_dev_ports() function, which is
left-over pre-configfs shutdown logic for when se_free_virtual_device()
was responsible for walking struct se_device-&gt;dev_sep_list and calling
core_dev_del_lun() for each individual active struct se_port-&gt;se_lun.

The reason this can be removed is because all struct se_device-&gt;dev_sep_list
-&gt; struct se_port communication is done via configfs symlinks, which
means that an target fabric module's endpoints containg active struct
se_port(s) will have to be released via target_core_fabric_configfs.c:
target_fabric_port_unlink() via:

	unlink /sys/kernel/config/target/$FABRIC_MOD/$ENDPOINT/tpgt_$TPGT/lun/lun_$LUN_ID/&lt;symlink&gt;

before rmdir release of struct se_device in target_core_configfs.c:
target_core_drop_subdev() -&gt; se_free_virtual_device() can happen via:

	rmdir /sys/kernel/config/target/core/$HBA/*

to release struct se_subsystem_dev in target_core_drop_subdev()

Reported-by: Stefan Richter &lt;stefanr@s5r6.in-berlin.de&gt;
Reported-by: Fubo Chen &lt;fubo.chen@gmail.com&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drivers: remove extraneous includes of smp_lock.h</title>
<updated>2011-03-01T23:02:40+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2011-01-25T21:08:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=5edc341313a188d94cde7ef87ac31647cea8601a'/>
<id>5edc341313a188d94cde7ef87ac31647cea8601a</id>
<content type='text'>
These were missed the last time I cleaned this up
globally, because of code moving around or new code
getting merged.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These were missed the last time I cleaned this up
globally, because of code moving around or new code
getting merged.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] target: Remove procfs based target_core_mib.c code</title>
<updated>2011-02-12T18:15:47+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2011-02-09T23:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e89d15eeadb172bd53ca6362bf9ab6b22077224c'/>
<id>e89d15eeadb172bd53ca6362bf9ab6b22077224c</id>
<content type='text'>
This patch removes the legacy procfs based target_core_mib.c code,
and moves the necessary scsi_index_tables functions and defines into
target_core_transport.c and target_core_base.h code to allow existing
fabric independent statistics to function.

This includes the removal of a handful of 'atomic_t mib_ref_count'
counters used in struct se_node_acl, se_session and se_hba to prevent
removal while using seq_list procfs walking logic.

[jejb: fix up compile failures]
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes the legacy procfs based target_core_mib.c code,
and moves the necessary scsi_index_tables functions and defines into
target_core_transport.c and target_core_base.h code to allow existing
fabric independent statistics to function.

This includes the removal of a handful of 'atomic_t mib_ref_count'
counters used in struct se_node_acl, se_session and se_hba to prevent
removal while using seq_list procfs walking logic.

[jejb: fix up compile failures]
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] target: fixed missing lock drop in error path</title>
<updated>2011-02-12T17:38:17+00:00</updated>
<author>
<name>Fubo Chen</name>
<email>fubo.chen@gmail.com</email>
</author>
<published>2011-02-09T23:34:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=85dc98d93f3dc41cce54118a7abab9e6aa616dd2'/>
<id>85dc98d93f3dc41cce54118a7abab9e6aa616dd2</id>
<content type='text'>
The struct se_node_acl-&gt;device_list_lock needs to be released if either
sanity check for struct se_dev_entry-&gt;se_lun_acl or deve-&gt;se_lun fails.

Signed-off-by: Fubo Chen &lt;fubo.chen@gmail.com&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The struct se_node_acl-&gt;device_list_lock needs to be released if either
sanity check for struct se_dev_entry-&gt;se_lun_acl or deve-&gt;se_lun fails.

Signed-off-by: Fubo Chen &lt;fubo.chen@gmail.com&gt;
Signed-off-by: Nicholas A. Bellinger &lt;nab@linux-iscsi.org&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
