Re: [PATCH] target: simplify the target template registration API

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

 



On 4/9/2015 9:24 AM, Nicholas A. Bellinger wrote:
On Wed, 2015-04-08 at 20:01 +0200, Christoph Hellwig wrote:
On Tue, Apr 07, 2015 at 11:12:50PM -0700, Nicholas A. Bellinger wrote:
So I was going to just merge this because having a single register
template function for fabric drivers does make alot of sense, but it
currently conflicts with the T10-PI fabric bits in for-next.  Sigh..

Looking further, I really don't like how the target_fabric_copy_attrs()
stuff works in target_register_template().  Just punting to direct use
struct configfs_attributes pointers in target_core_fabric_ops is a hack.

I'd much rather see target_fabric_setup_cits() do this proper setup,
instead of unnecessarily duplicating the target_core_fabric_configfs.c
list of defined config_item_types in two new locations.

Does this version look better?  It adds a new TF_CIT_SETUP_DRV macro,
so that the core configfs code can declare attributes as either core
only or for drivers.  That way we also avoid the case where the core
code defines an attribute and a fabric driver accidentally overrides it.

It's also been rebased to latest target/for-next.

Thanks HCH.

Applied to target-pending/for-next code.


This patch gives me a BUG_ON() when unloading the target stack
while having open sessions.

kernel: isert: isert_release_work: Starting release conn ffff88046b2df000
kernel: ------------[ cut here ]------------
kernel: kernel BUG at drivers/target/target_core_configfs.c:491!
kernel: invalid opcode: 0000 [#1] SMP
kernel: Modules linked in: ib_ipoib mlx5_ib mlx5_core tcm_loop vhost_scsi vhost ib_srpt ib_isert iscsi_target_mod rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr tcm_fc(-) libfc target_core_file target_core_iblock target_core_pscsi target_core_mod netconsole configfs nfsd exportfs nfsv3 nfs_acl rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs fscache lockd grace autofs4 sunrpc cpufreq_ondemand ipv6 ext4 jbd2 dm_mirror dm_region_hash dm_log uinput iTCO_wdt iTCO_vendor_support sg microcode pcspkr serio_raw sb_edac edac_core i2c_i801 lpc_ich mfd_core shpchp ipmi_si ipmi_msghandler acpi_cpufreq ioatdma igb dm_mod dca i2c_algo_bit i2c_core ptp pps_core wmi ext3(E) jbd(E) mbcache(E) sd_mod(E) ahci(E) libahci(E) isci(E) libsas(E) scsi_transport_sas(E) qla2xxx(E) scsi_transport_fc(E) [last unloaded: ip_tables] kernel: CPU: 18 PID: 9277 Comm: rmmod Tainted: G E 4.0.0-rc1+ #38
kernel: Hardware name: Supermicro SYS-1027R-WRF/X9DRW, BIOS 3.0a 08/08/2013
kernel: task: ffff88085ccee4d0 ti: ffff88087d834000 task.ti: ffff88087d834000 kernel: RIP: 0010:[<ffffffffa02b538f>] [<ffffffffa02b538f>] target_unregister_template+0x8f/0xa0 [target_core_mod]
kernel: RSP: 0018:ffff88087d837ed8  EFLAGS: 00010202
kernel: RAX: 0000000000000001 RBX: ffff88046dfaa000 RCX: dead000000200200
kernel: RDX: 0000000000000066 RSI: ffffffffa03637a8 RDI: ffff88046dfaa001
kernel: RBP: ffff88087d837ef8 R08: ffff88087d837e30 R09: 0000000000000001
kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffff88046dfaa028
kernel: R13: ffffffffa03637a7 R14: 0000000000000000 R15: 0000000000000001
kernel: FS: 00007fa398977700(0000) GS:ffff88087fcc0000(0000) knlGS:0000000000000000
kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
kernel: CR2: 00007ffc4bcd0fa0 CR3: 000000085fb98000 CR4: 00000000000406e0
kernel: Stack:
kernel: ffff88087d837ef8 ffffffffa03640c0 00007ffc4bcd3f00 00007ffc4bcd472d
kernel: ffff88087d837f08 ffffffffa0362e8e ffff88087d837f78 ffffffff810c0ffa
kernel: 0000000000001000 00007ffc4bcd1668 000063665f6d6374 ffffffff8112df07
kernel: Call Trace:
kernel: [<ffffffffa0362e8e>] ft_exit+0x42/0x49 [tcm_fc]
kernel: [<ffffffff810c0ffa>] SyS_delete_module+0x17a/0x1c0
kernel: [<ffffffff8112df07>] ? vm_munmap+0x57/0x70
kernel: [<ffffffff8112df47>] ? SyS_munmap+0x27/0x40
kernel: [<ffffffff81542f12>] system_call_fastpath+0x12/0x17
kernel: Code: 85 c0 75 27 4c 89 e7 e8 f0 d4 fa e0 48 89 df e8 c8 75 e9 e0 48 c7 c7 c0 41 2e a0 e8 0c b6 28 e1 48 83 c4 08 5b 41 5c 41 5d c9 c3 <0f> 0b eb fe 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 kernel: RIP [<ffffffffa02b538f>] target_unregister_template+0x8f/0xa0 [target_core_mod]
kernel: RSP <ffff88087d837ed8>
kernel: ---[ end trace 941091da91c60226 ]---
--
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