[PATCH] tcm_fc: Remove bogus se_cmd setup in ft_send_tm with target_submit_tmr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

This patch removes bogus callers for se_cmd init/setup during task management
processing in ft_send_tm(), that was resulting in sess->sess_cmd_list
corruption (see below) due to the re-initialization in transport_init_se_cmd().

During the recent git merge for v3.3-rc6 in lio-core.git, this code (from
mainline) was incorrectly re-added into ft_send_tm() together with the new
target_submit_tmr() usage.  This code had been originally removed during
conversion of tcm_fc to use target_submit_tmr() here:

commit 7231cccbea2112964279d9ff345f96d4441d011a
Author: Andy Grover <agrover@xxxxxxxxxx>
Date:   Thu Jan 19 13:39:22 2012 -0800

    target/fc: Use target_submit_tmr()

Here is the associated list_debug.c output when triggering the bug with
TMR LUN_RESET:

[ 4628.885338] scsi17 : FCoE Driver
[ 4628.889366] host17: libfc: Link up on port (000000)
[ 4629.393498] host17: Assigned Port ID 005b31
[ 4650.195193] ------------[ cut here ]------------
[ 4650.200342] WARNING: at lib/list_debug.c:30 __list_add+0x68/0x80()
[ 4650.207226] Hardware name: S5520HC
[ 4650.211014] list_add corruption. prev->next should be next (ffff88015bd1ddc0), but was ffff880211347010. (prev=ffff880211347010).
[ 4650.223999] Modules linked in: fcoe libfcoe tcm_vhost ib_srpt tcm_qla2xxx tcm_loop tcm_fc iscsi_target_mod target_core_pscsi target_core_file target_core_iblock target_core_mod qla2xxx ib_cm ib_sa ib_mad ib_core libfc configfs ipv6 loop i2c_i801 button joydev pcspkr i2c_core ext3 jbd uhci_hcd ata_piix libata ehci_hcd mlx4_core scsi_transport_fc scsi_tgt igb [last unloaded: qla2xxx]
[ 4650.262057] Pid: 4, comm: kworker/0:0 Tainted: G           O 3.3.0-rc6+ #45
[ 4650.269813] Call Trace:
[ 4650.272537]  [<ffffffff81027eb3>] warn_slowpath_common+0x80/0x98
[ 4650.279237]  [<ffffffffa00d46e1>] ? core_tmr_alloc_req+0x3a/0x8d [target_core_mod]
[ 4650.287671]  [<ffffffff81027f5f>] warn_slowpath_fmt+0x41/0x43
[ 4650.294072]  [<ffffffff81197cd8>] __list_add+0x68/0x80
[ 4650.299800]  [<ffffffffa00d746a>] target_get_sess_cmd+0x6e/0x86 [target_core_mod]
[ 4650.308140]  [<ffffffffa00d956d>] target_submit_tmr+0x90/0xf1 [target_core_mod]
[ 4650.316284]  [<ffffffffa00b954d>] ft_send_work+0x181/0x28d [tcm_fc]
[ 4650.323270]  [<ffffffffa0003f80>] ? igb_watchdog_task+0x43e/0x44d [igb]
[ 4650.330633]  [<ffffffff8109f1c3>] ? refresh_cpu_vm_stats+0x102/0x102
[ 4650.337714]  [<ffffffffa00b93cc>] ? ft_send_resp_code_and_free+0x32/0x32 [tcm_fc]
[ 4650.346053]  [<ffffffff8103cbb5>] process_one_work+0x1f9/0x32c
[ 4650.352550]  [<ffffffff8103d0e0>] worker_thread+0x1ff/0x34f
[ 4650.358760]  [<ffffffff81046368>] ? __wake_up_common+0x49/0x7f
[ 4650.365258]  [<ffffffff8103cee1>] ? rescuer_thread+0x1f9/0x1f9
[ 4650.371757]  [<ffffffff81040515>] kthread+0x84/0x8c
[ 4650.377192]  [<ffffffff8135dde4>] kernel_thread_helper+0x4/0x10
[ 4650.383787]  [<ffffffff81040491>] ? kthread_freezable_should_stop+0x70/0x70
[ 4650.391545]  [<ffffffff8135dde0>] ? gs_change+0x13/0x13
[ 4650.397365] ---[ end trace adb79c77048b2dec ]---
[ 4650.403532] ------------[ cut here ]------------

Reported-by: Mark D Rustad <mark.d.rustad@xxxxxxxxx>
Cc: Mark D Rustad <mark.d.rustad@xxxxxxxxx>
Cc: Kiran Patil <kiran.patil@xxxxxxxxx>
Cc: Andy Grover <agrover@xxxxxxxxxx>
Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
---
 drivers/target/tcm_fc/tfc_cmd.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index c4e9d06..346e72d 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -352,11 +352,6 @@ static void ft_send_tm(struct ft_cmd *cmd)
 	int rc;
 	u8 tm_func;
 
-	transport_init_se_cmd(&cmd->se_cmd, &ft_configfs->tf_ops,
-			cmd->sess->se_sess, 0, DMA_NONE, 0,
-			&cmd->ft_sense_buffer[0]);
-	target_get_sess_cmd(cmd->sess->se_sess, &cmd->se_cmd, false);
-
 	fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
 	switch (fcp->fc_tm_flags) {
 	case FCP_TMF_LUN_RESET:
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux