Hello! A follow-up to https://github.com/karelzak/util-linux/issues/903 trying to use losetup with big loop number, generating a kernel stack trace: $ modprobe loop $ touch somefile $ losetup /dev/loop1048576 somefile kernel logs (sparc64): $ uname -a Linux ttip 5.7.0-12703-gaf7b4801030c #142 SMP Mon Jun 8 11:34:57 MSK 2020 sparc64 GNU/Linux [ 53.068591] loop: module loaded [ 58.795265] sysfs: cannot create duplicate filename '/devices/virtual/bdi/7:0' [ 58.795413] CPU: 24 PID: 1246 Comm: losetup Not tainted 5.7.0-12703-gaf7b4801030c #142 [ 58.795474] Call Trace: [ 58.795511] [000000000079d030] sysfs_warn_dup+0x50/0x80 [ 58.795557] [000000000079d154] sysfs_create_dir_ns+0x94/0xe0 [ 58.795608] [0000000000977880] kobject_add_internal+0x140/0x3a0 [ 58.795656] [0000000000977b5c] kobject_add+0x7c/0xa0 [ 58.795700] [00000000009d9104] device_add+0x164/0x7c0 [ 58.795743] [00000000009d98fc] device_create_groups_vargs+0x7c/0xc0 [ 58.795792] [00000000009d996c] device_create+0x2c/0x40 [ 58.795839] [0000000000655088] bdi_register_va+0x48/0x2c0 [ 58.795884] [0000000000655324] bdi_register+0x24/0x40 [ 58.795929] [0000000000920920] __device_add_disk+0x240/0x5a0 [ 58.795976] [0000000000920c98] device_add_disk+0x18/0x40 [ 58.796024] [00000000100400b0] loop_add+0x1f0/0x260 [loop] [ 58.796071] [0000000010040234] loop_control_ioctl+0x74/0x140 [loop] [ 58.796122] [00000000006f8d58] ksys_ioctl+0x78/0xc0 [ 58.796163] [00000000006f8db4] sys_ioctl+0x14/0x40 [ 58.796207] [0000000000406294] linux_sparc_syscall+0x34/0x44 [ 58.796258] kobject_add_internal failed for 7:0 with -EEXIST, don't try to register things with the same name in the same directory. kernel logs ppc64: $ uname -a Linux ap-gcc1-ppc64 5.7.0 #78 SMP Mon Jun 1 13:10:19 MSK 2020 ppc64 GNU/Linux kernel: loop: module loaded kernel: sysfs: cannot create duplicate filename '/devices/virtual/bdi/7:0' kernel: CPU: 8 PID: 99033 Comm: losetup Tainted: G E 5.7.0 #78 kernel: Call Trace: kernel: [c0000007c9213350] [c00000000068e404] .dump_stack+0xb0/0xfc (unreliable) kernel: [c0000007c92133e0] [c0000000005632f0] .sysfs_warn_dup+0x80/0xb0 kernel: [c0000007c9213470] [c0000000005634fc] .sysfs_create_dir_ns+0x11c/0x140 kernel: [c0000007c9213510] [c000000000697c18] .kobject_add_internal+0x108/0x460 kernel: [c0000007c92135b0] [c000000000697fd4] .kobject_add+0x64/0xe0 kernel: [c0000007c9213640] [c00000000076a610] .device_add+0x150/0xa10 kernel: [c0000007c9213720] [c00000000076b198] .device_create_groups_vargs+0x118/0x1e0 kernel: [c0000007c92137d0] [c00000000076b318] .device_create+0x58/0x70 kernel: [c0000007c9213850] [c000000000388c40] .bdi_register_va.part.0+0x70/0x380 kernel: [c0000007c9213900] [c000000000389060] .bdi_register+0x80/0xa0 kernel: [c0000007c9213980] [c0000000003890c4] .bdi_register_owner+0x44/0x90 kernel: [c0000007c9213a10] [c000000000627c98] .__device_add_disk+0x538/0x5f0 kernel: [c0000007c9213ae0] [c0080000003b2d9c] .loop_add+0x25c/0x310 [loop] kernel: [c0000007c9213b90] [c0080000003b3058] .loop_control_ioctl+0xf8/0x1b0 [loop] kernel: [c0000007c9213c50] [c00000000047c96c] .ksys_ioctl+0xfc/0x160 kernel: [c0000007c9213cf0] [c00000000047ca08] .__se_sys_ioctl+0x38/0xa0 kernel: [c0000007c9213d70] [c00000000002ecb4] .system_call_exception+0x144/0x220 kernel: [c0000007c9213e20] [c00000000000d1e8] system_call_common+0xe8/0x214 kernel: kobject_add_internal failed for 7:0 with -EEXIST, don't try to register things with the same name in the same directory tested with latest git kernel on sparc64 and 5.7.0 tag on ppc64