Hi Sebastian, On Sun, 2014-06-15 at 15:24 +0200, Sebastian Herbszt wrote: > Hello, > > I hit the following oops with > > # modprobe target_core_mod > # modprobe target_core_file > # modprobe tcm_loop > > # mkdir -p /sys/kernel/config/target/core/fileio_0/file0 > # echo 'fd_dev_name=/disk1,fd_dev_size=10485760' > /sys/kernel/config/target/core/fileio_0/file0/control > # echo 1 > /sys/kernel/config/target/core/fileio_0/file0/enable > > # mkdir -p /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0 > # cat /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/alua_tg_pt_gp > cat: /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/alua_tg_pt_gp: No such device > > # ln -s /sys/kernel/config/target/core/fileio_0/file0 /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/file0 > > # cat /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/alua_tg_pt_gp > TG Port Alias: default_tg_pt_gp > TG Port Group ID: 0 > TG Port Primary Access State: Active/Optimized > TG Port Primary Access Status: None > TG Port Secondary Access State: None > TG Port Secondary Access Status: None > > # rm /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/file0 > # cat /sys/kernel/config/target/loopback/fc.1/tpgt_0/lun/lun_0/alua_tg_pt_gp > Killed > > Sebastian > > [ 101.372606] scsi3 : TCM_Loopback > [ 111.513343] scsi 3:0:0:0: TCM_Loop I_T Nexus does not exist > [ 111.527553] scsi 3:0:0:0: TCM_Loop I_T Nexus does not exist > [ 111.547391] scsi 3:0:0:0: TCM_Loop I_T Nexus does not exist > [ 111.567619] scsi 3:0:0:0: TCM_Loop I_T Nexus does not exist > [ 121.657247] Unable to locate struct scsi_device for 0:0:0 > [ 127.335146] BUG: unable to handle kernel NULL pointer dereference at 0000000000000009 > [ 127.336475] IP: [<ffffffff815b8e1a>] _raw_spin_lock+0xa/0x30 > [ 127.337065] PGD 3633f067 PUD 318a6067 PMD 0 > [ 127.337655] Oops: 0002 [#1] SMP > [ 127.338206] Modules linked in: target_core_pscsi target_core_iblock tcm_loop target_core_file target_core_mod configfs xfs libcrc32c sr_mod cdrom ata_generic irda vmw_balloon ppdev floppy pcspkr crc_ccitt parport_pc parport ata_piix mptctl i2c_piix4 battery button ac vmw_vmci shpchp e1000 sg mptspi mptscsih mptbase scsi_transport_spi vmwgfx ttm drm processor scsi_dh_alua scsi_dh_emc scsi_dh_rdac scsi_dh_hp_sw scsi_dh > [ 127.341152] CPU: 0 PID: 1704 Comm: cat Not tainted 3.15.0-2.gc9b3c8c-default #1 > [ 127.341769] Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/02/2012 > [ 127.342919] task: ffff880035188210 ti: ffff88002e504000 task.ti: ffff88002e504000 > [ 127.343521] RIP: 0010:[<ffffffff815b8e1a>] [<ffffffff815b8e1a>] _raw_spin_lock+0xa/0x30 > [ 127.344113] RSP: 0018:ffff88002e507e98 EFLAGS: 00010202 > [ 127.344702] RAX: 0000000000010000 RBX: 0000000000000001 RCX: ffffffffa0344050 > [ 127.345291] RDX: ffff880035046000 RSI: ffff880035046000 RDI: 0000000000000009 > [ 127.345892] RBP: ffff880035012940 R08: ffffffff8181a880 R09: ffffea0000b98f88 > [ 127.346479] R10: 0000000000003621 R11: 0000000000000246 R12: 0000000000000000 > [ 127.347066] R13: ffff880035046000 R14: ffff88002e507f58 R15: 00000000013c3000 > [ 127.347713] FS: 00007ffa8475f700(0000) GS:ffff88003f600000(0000) knlGS:0000000000000000 > [ 127.348313] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > [ 127.349094] CR2: 0000000000000009 CR3: 000000003ceb2000 CR4: 00000000000407f0 > [ 127.349774] Stack: > [ 127.350433] ffffffffa034dd2e ffff88003c647f60 ffffffffa037bee0 ffff88003c647f40 > [ 127.351116] ffff88003c647f60 ffffffffa037bee0 0000000000010000 ffffffffa02136de > [ 127.351802] ffffffffa037c020 ffff880030054c60 ffff880035f0a500 00000000013c3000 > [ 127.352493] Call Trace: > [ 127.353199] [<ffffffffa034dd2e>] core_alua_show_tg_pt_gp_info+0x2e/0x100 [target_core_mod] > [ 127.353927] [<ffffffffa02136de>] configfs_read_file+0xae/0x150 [configfs] > [ 127.354625] [<ffffffff811a4086>] vfs_read+0x96/0x160 > [ 127.355301] [<ffffffff811a4c62>] SyS_read+0x42/0xa0 > [ 127.355978] [<ffffffff815c17ed>] system_call_fastpath+0x1a/0x1f > [ 127.356660] [<00007ffa8428e830>] 0x7ffa8428e82f > [ 127.357333] Code: fa 66 66 90 66 66 90 3e 81 2f 00 00 10 00 74 05 e8 3c e2 d4 ff 48 89 d0 c3 0f 1f 84 00 00 00 00 00 66 66 66 66 90 b8 00 00 01 00 <3e> 0f c1 07 89 c2 c1 ea 10 66 39 c2 89 d1 75 01 c3 0f b7 07 66 > [ 127.359551] RIP [<ffffffff815b8e1a>] _raw_spin_lock+0xa/0x30 > [ 127.360269] RSP <ffff88002e507e98> > [ 127.360942] CR2: 0000000000000009 > [ 127.361654] ---[ end trace e1cd9f3bb7e17a46 ]--- > -- Thanks for reporting. So there is a left-over pointer here that is preventing the checks in target_core_fabric_configfs.c:target_fabric_port_*_attr_alua_*() from working as expected. Below is the patch that I'll be adding to address this issue. Please confirm on your end. --nab diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 26416c1..6ea95d2 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -616,6 +616,7 @@ void core_dev_unexport( dev->export_count--; spin_unlock(&hba->device_lock); + lun->lun_sep = NULL; lun->lun_se_dev = NULL; } -- 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