6.17.0, mount: /mnt/0: fsconfig() failed: File exists.
Subsystems (2)
kernel-6.17.0-0.rc7.56.fc43.x86_64
btrfs-progs-6.16.1-1.fc43.x86_64
Downstream bug includes full dmesg attached:
https://bugzilla.redhat.com/show_bug.cgi?id=2399959
File system is already mounted, but I need access to the top-level of the file system.
$ sudo mount /dev/dm-0 /mnt/0
mount: /mnt/0: fsconfig() failed: File exists.
dmesg(1) may have more information after failed mount system call.dmesg
[ 670.350492] BTRFS: device fsid 958beb6e-eadb-469f-9b33-a06db5a014e7 devid 1 transid 1512 /dev/mapper/luks-32d2f2ad-a545-4aba-b5c7-3fa9135d12bf (252:0) scanned by mount (1324) [ 670.352174] BTRFS info (device dm-0): first mount of filesystem 958beb6e-eadb-469f-9b33-a06db5a014e7 [ 670.352302] BTRFS info (device dm-0): using crc32c (crc32c-lib) checksum algorithm [ 670.361200] sysfs: cannot create duplicate filename '/fs/btrfs/958beb6e-eadb-469f-9b33-a06db5a014e7' [ 670.361294] CPU: 3 UID: 0 PID: 1324 Comm: mount Not tainted 6.17.0-0.rc7.56.fc43.x86_64 #1 PREEMPT(full) [ 670.361300] Hardware name: /NUC5PPYB, BIOS PYBSWCEL.86A.0081.2022.0823.1419 08/23/2022 [ 670.361303] Call Trace: [ 670.361309] <TASK> [ 670.361314] dump_stack_lvl+0x5d/0x80 [ 670.361324] sysfs_warn_dup.cold+0x17/0x23 [ 670.361331] sysfs_create_dir_ns+0xcc/0xe0 [ 670.361341] kobject_add_internal+0xbc/0x260 [ 670.361347] kobject_init_and_add+0x8e/0xc0 [ 670.361352] ? btrfs_init_dev_replace+0x176/0x5c0 [ 670.361357] btrfs_sysfs_add_fsid+0x5e/0x120 [ 670.361363] open_ctree+0x71c/0xb30 [ 670.361369] btrfs_get_tree_super.cold+0xb/0xac [ 670.361372] ? security_fs_context_dup+0x52/0x100 [ 670.361378] btrfs_get_tree_subvol+0xfe/0x1f0 [ 670.361383] vfs_get_tree+0x26/0xd0 [ 670.361389] vfs_cmd_create+0x57/0xd0 [ 670.361395] __do_sys_fsconfig+0x4b6/0x650 [ 670.361401] do_syscall_64+0x7e/0x250 [ 670.361406] ? do_syscall_64+0xb6/0x250 [ 670.361410] ? do_faccessat+0x1d7/0x2d0 [ 670.361414] ? do_syscall_64+0xb6/0x250 [ 670.361418] ? __x64_sys_fsopen+0xb9/0x110 [ 670.361422] ? do_syscall_64+0xb6/0x250 [ 670.361426] ? arch_exit_to_user_mode_prepare.isra.0+0x6a/0xa0 [ 670.361431] ? irqentry_exit_to_user_mode+0x2c/0x1c0 [ 670.361436] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 670.361441] RIP: 0033:0x7f95ef1cd3ce [ 670.361470] Code: 73 01 c3 48 8b 0d 32 3a 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 49 89 ca b8 af 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 02 3a 0f 00 f7 d8 64 89 01 48 [ 670.361473] RSP: 002b:00007ffee85650d8 EFLAGS: 00000246 ORIG_RAX: 00000000000001af [ 670.361478] RAX: ffffffffffffffda RBX: 00005621c0d2b710 RCX: 00007f95ef1cd3ce [ 670.361480] RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003 [ 670.361482] RBP: 00007ffee8565220 R08: 0000000000000000 R09: 0000000000000000 [ 670.361484] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 [ 670.361486] R13: 00005621c0d2d4e0 R14: 00007f95ef34ea60 R15: 00005621c0d2d578 [ 670.361491] </TASK> [ 670.361494] kobject: kobject_add_internal failed for 958beb6e-eadb-469f-9b33-a06db5a014e7 with -EEXIST, don't try to register things with the same name in the same directory. [ 670.362231] BTRFS error (device dm-0): failed to init sysfs fsid interface: -17 [ 670.365833] BTRFS error (device dm-0): open_ctree failed: -17
This doesn't always happen. I'm not sure what the pattern is yet.
--
Chris Murphy
Quoted 2 lines · Chris Murphy
Downstream bug includes full dmesg attached:
https://bugzilla.redhat.com/show_bug.cgi?id=2399959
OK so this is a case of two devices with the same fsid. I simply forgot I had plugged in the original device planning to wipe it - its replacement is a new fs using metadata_uuid, with the original fsid.
But the two identical fsid's is the source of all this confusion, both user and I think the kernel is also confused.
I've added more details to the downstream bug report, including strace.
Signature · 1 line
Chris Murphy