Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933611AbcKIQAN (ORCPT ); Wed, 9 Nov 2016 11:00:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44768 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753315AbcKIQAL (ORCPT ); Wed, 9 Nov 2016 11:00:11 -0500 Cc: Sudip Mukherjee To: "linux-kernel@vger.kernel.org" From: Joe Lawrence Subject: [ppdev] sysfs warning on qemu boot Organization: Red Hat Message-ID: <0039c5ca-0a77-968c-7356-07977242474b@redhat.com> Date: Wed, 9 Nov 2016 11:00:10 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 09 Nov 2016 16:00:11 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 10570 Lines: 220 Hi Sudip, I hit a sysfs_warn_dup inside QEMU running 4.9.0-rc4 (I suspect earlier versions as well, but this is the first upstream I've run in a while). This warning looks like something the kernel test robot ran into a few months ago: http://marc.info/?t=147267773300003&r=1&w=2 I'm running CentOS7 inside QEMU with the following options: qemu-system-x86_64 -smp 4 -m 8192 \ -drive file=centos7.qcow2,cache=none,if=virtio \ -usbdevice tablet -enable-kvm -monitor stdio \ -parallel /dev/null -redir tcp:2222::22 \ -serial file:serial.out a kernel with these options: % grep PARPORT .config CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_PARPORT=m CONFIG_PARPORT_PC=m # CONFIG_PARPORT_SERIAL is not set # CONFIG_PARPORT_PC_FIFO is not set # CONFIG_PARPORT_PC_SUPERIO is not set # CONFIG_PARPORT_GSC is not set # CONFIG_PARPORT_AX88796 is not set CONFIG_PARPORT_1284=y # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set and I see the following warning on boot: ppdev: user-space parallel port driver ------------[ cut here ]------------ WARNING: CPU: 2 PID: 581 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x64/0x80 sysfs: cannot create duplicate filename '/devices/pnp0/00:04/ppdev/parport0' Modules linked in: ppdev sg parport_pc(+) parport pcspkr i2c_piix4 ip_tables xfs libcrc32c sr_mod cdrom ata_generic pata_acpi cirrus drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm virtio_blk e1000 virtio_pci ata_piix virtio_ring i2c_core libata virtio serio_raw floppy dm_mirror dm_region_hash dm_log dm_mod CPU: 2 PID: 581 Comm: systemd-udevd Not tainted 4.9.0-rc4+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.5.1 01/01/2011 ffffc900014c76f8 ffffffff81351b2f ffffc900014c7748 0000000000000000 ffffc900014c7738 ffffffff8108bab1 0000001f00001000 ffff8802280bc548 ffff88022c290c68 ffff880225c98398 ffff88022d834bd8 0000000006300000 Call Trace: [] dump_stack+0x63/0x84 [] __warn+0xd1/0xf0 [] warn_slowpath_fmt+0x5f/0x80 [] ? kernfs_path_from_node+0x50/0x60 [] sysfs_warn_dup+0x64/0x80 [] sysfs_create_dir_ns+0x7e/0x90 [] kobject_add_internal+0xa2/0x320 [] ? device_private_init+0x23/0x70 [] kobject_add+0x75/0xd0 [] ? mutex_lock+0x12/0x2f [] device_add+0x119/0x610 [] device_create_groups_vargs+0xd8/0x100 [] ? dead_read+0x10/0x10 [parport] [] device_create+0x51/0x70 [] ? kfree+0x121/0x170 [] ? klist_next+0x20/0xf0 [] pp_attach+0x34/0x40 [ppdev] [] driver_check+0x17/0x20 [parport] [] bus_for_each_drv+0x68/0xb0 [] attach_driver_chain+0x59/0x60 [parport] [] parport_announce_port+0xc0/0x110 [parport] [] parport_pc_probe_port+0x70c/0xb20 [parport_pc] [] ? kernfs_activate+0x7a/0xe0 [] ? _dev_info+0x6c/0x90 [] parport_pc_pnp_probe+0x145/0x1e0 [parport_pc] [] ? sio_via_probe+0x430/0x430 [parport_pc] [] pnp_device_probe+0x61/0xc0 [] driver_probe_device+0x227/0x440 [] __driver_attach+0xdd/0xe0 [] ? driver_probe_device+0x440/0x440 [] bus_for_each_dev+0x6c/0xc0 [] driver_attach+0x1e/0x20 [] bus_add_driver+0x45/0x270 [] driver_register+0x60/0xe0 [] pnp_register_driver+0x20/0x30 [] parport_pc_init+0x2b5/0xf1d [parport_pc] [] ? parport_parse_param.constprop.15+0xe3/0xe3 [parport_pc] [] do_one_initcall+0x50/0x190 [] ? do_init_module+0x27/0x1f1 [] ? kmem_cache_alloc_trace+0x16c/0x1b0 [] do_init_module+0x60/0x1f1 [] load_module+0x15ab/0x1aa0 [] ? __symbol_put+0x60/0x60 [] ? ima_post_read_file+0x3d/0x80 [] ? security_kernel_post_read_file+0x6b/0x80 [] SYSC_finit_module+0xa6/0xf0 [] SyS_finit_module+0xe/0x10 [] entry_SYSCALL_64_fastpath+0x1a/0xa9 ---[ end trace 8304e3df5abed4a7 ]--- ------------[ cut here ]------------ WARNING: CPU: 2 PID: 581 at lib/kobject.c:240 kobject_add_internal+0x2b5/0x320 kobject_add_internal failed for parport0 with -EEXIST, don't try to register things with the same name in the same directory. Modules linked in: ppdev sg parport_pc(+) parport pcspkr i2c_piix4 ip_tables xfs libcrc32c sr_mod cdrom ata_generic pata_acpi cirrus drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm drm virtio_blk e1000 virtio_pci ata_piix virtio_ring i2c_core libata virtio serio_raw floppy dm_mirror dm_region_hash dm_log dm_mod CPU: 2 PID: 581 Comm: systemd-udevd Tainted: G W 4.9.0-rc4+ #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.5.1 01/01/2011 ffffc900014c7748 ffffffff81351b2f ffffc900014c7798 0000000000000000 ffffc900014c7788 ffffffff8108bab1 000000f02c290c68 ffff880226a0afe8 ffff88022d834bd8 00000000ffffffef ffff88022d834bd8 0000000006300000 Call Trace: [] dump_stack+0x63/0x84 [] __warn+0xd1/0xf0 [] warn_slowpath_fmt+0x5f/0x80 [] kobject_add_internal+0x2b5/0x320 [] ? device_private_init+0x23/0x70 [] kobject_add+0x75/0xd0 [] ? mutex_lock+0x12/0x2f [] device_add+0x119/0x610 [] device_create_groups_vargs+0xd8/0x100 [] ? dead_read+0x10/0x10 [parport] [] device_create+0x51/0x70 [] ? kfree+0x121/0x170 [] ? klist_next+0x20/0xf0 [] pp_attach+0x34/0x40 [ppdev] [] driver_check+0x17/0x20 [parport] [] bus_for_each_drv+0x68/0xb0 [] attach_driver_chain+0x59/0x60 [parport] [] parport_announce_port+0xc0/0x110 [parport] [] parport_pc_probe_port+0x70c/0xb20 [parport_pc] [] ? kernfs_activate+0x7a/0xe0 [] ? _dev_info+0x6c/0x90 [] parport_pc_pnp_probe+0x145/0x1e0 [parport_pc] [] ? sio_via_probe+0x430/0x430 [parport_pc] [] pnp_device_probe+0x61/0xc0 [] driver_probe_device+0x227/0x440 [] __driver_attach+0xdd/0xe0 [] ? driver_probe_device+0x440/0x440 [] bus_for_each_dev+0x6c/0xc0 [] driver_attach+0x1e/0x20 [] bus_add_driver+0x45/0x270 [] driver_register+0x60/0xe0 [] pnp_register_driver+0x20/0x30 [] parport_pc_init+0x2b5/0xf1d [parport_pc] [] ? parport_parse_param.constprop.15+0xe3/0xe3 [parport_pc] [] do_one_initcall+0x50/0x190 [] ? do_init_module+0x27/0x1f1 [] ? kmem_cache_alloc_trace+0x16c/0x1b0 [] do_init_module+0x60/0x1f1 [] load_module+0x15ab/0x1aa0 [] ? __symbol_put+0x60/0x60 [] ? ima_post_read_file+0x3d/0x80 [] ? security_kernel_post_read_file+0x6b/0x80 [] SYSC_finit_module+0xa6/0xf0 [] SyS_finit_module+0xe/0x10 [] entry_SYSCALL_64_fastpath+0x1a/0xa9 ---[ end trace 8304e3df5abed4a8 ]--- I can repeat the warnings by unloading and reloading the parallel port drivers: rmmod parport_pc ppdev parport modprobe parport_pc Instrumenting sysfs_create_dir_ns when adding '/devices/pnp0/00:04/ppdev/parport0', I see one call from ppdev/parport drivers: entry_SYSCALL_64_fastpath SyS_finit_module SYSC_finit_module load_module do_init_module do_one_initcall ppdev_init [ppdev] __parport_register_driver [parport] bus_for_each_dev port_check[parport] pp_attach[ppdev] device_create device_create_groups_vargs device_add kobject_add kobject_add_internal sysfs_create_dir_ns and then a follow up call to add the same sysfs directory via the parport_pc driver: entry_SYSCALL_64_fastpath SyS_finit_module SYSC_finit_module load_module do_init_module do_one_initcall parport_pc_init [parport_pc] pnp_register_driver driver_register bus_add_driver driver_attach bus_for_each_dev __driver_attach driver_probe_device pnp_device_probe parport_pc_pnp_probe [parport_pc] parport_pc_probe_port [parport_pc] parport_announce_port [parport] attach_driver_chain [parport] bus_for_each_drv driver_check [parport] pp_attach[ppdev] device_create device_create_groups_vargs device_add kobject_add kobject_add_internal sysfs_create_dir_ns This warning is readily reproducible in my current VM setup, so I can test patches or further debugging if necessary. Hope this helps, -- Joe