After unmounting and remounting a simplefs image, looking up a name in a directory that has had a file created in it causes a kernel soft-lockup. The accessing process is stuck in uninterruptible (D) state, the mount is wedged, and a reboot is required.
echo hi > test/foo # allocates the extent
umount test
mount -o loop -t simplefs test.img test
stat test/bar
dmesg shows:
[86842.961683] watchdog: BUG: soft lockup - CPU#0 stuck for 26s! [stat:11121]
[86842.962293] Modules linked in: simplefs(OE) tls isofs binfmt_misc nls_iso8859_1 ppdev kvm_amd ccp kvm irqbypass parport_pc parport joydev input_leds serio_raw sch_fq_codel dm_multipath msr efi_pstore nfnetlink dmi_sysfs ip_tables x_tables autofs4 btrfs blake2b_generic raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid1 raid0 crct10dif_pclmul crc32_pclmul polyval_clmulni polyval_generic ghash_clmulni_intel psmouse sha256_ssse3 sha1_ssse3 floppy aesni_intel crypto_simd cryptd [last unloaded: simplefs(OE)]
[86842.962328] CPU: 0 PID: 11121 Comm: stat Tainted: G OE 6.8.0-124-generic #124-Ubuntu
[86842.962330] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 0.0.0 02/06/2015
[86842.962332] RIP: 0010:__file_lookup+0x226/0x480 [simplefs]
[86842.962341] Code: cc 44 89 f3 89 55 b0 4d 63 f5 49 83 fe 10 0f 83 76 01 00 00 4c 89 f0 48 c1 e0 05 4c 01 f0 48 c1 e0 03 4d 8d 04 04 41 8b 50 04 <85> d2 74 1f 49 8b 77 28 49 8d 7c 04 0c ba fe 00 00 00 4c 89 45 d0
[86842.962343] RSP: 0018:ffffcf800129f9d0 EFLAGS: 00000256
[86842.962344] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[86842.962345] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8acabe6283a8
[86842.962346] RBP: ffffcf800129fa68 R08: ffff8acb305b1000 R09: ffff8acb305b1000
[86842.962346] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8acb305b1000
[86842.962347] R13: 0000000000000000 R14: 0000000000000000 R15: ffff8acb041c9780
[86842.962351] FS: 000070b163163800(0000) GS:ffff8acbb7c00000(0000) knlGS:0000000000000000
[86842.962353] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[86842.962354] CR2: 000057dc28718170 CR3: 00000001022fc000 CR4: 0000000000750ef0
[86842.962358] PKRU: 55555554
[86842.962360] Call Trace:
[86842.962361] <TASK>
[86842.962366] simplefs_lookup+0xb4/0x1b0 [simplefs]
[86842.962369] __lookup_slow+0x82/0x130
[86842.962375] walk_component+0x117/0x190
[86842.962377] path_lookupat+0x6a/0x1b0
[86842.962379] filename_lookup+0xe4/0x200
[86842.962380] vfs_statx+0x95/0x1d0
[86842.962383] do_statx+0x64/0xb0
[86842.962385] __x64_sys_statx+0x67/0x90
[86842.962386] x64_sys_call+0x2235/0x25a0
[86842.962390] do_syscall_64+0x7f/0x180
[86842.962396] ? count_memcg_events.constprop.0+0x2a/0x50
[86842.962399] ? handle_mm_fault+0xad/0x380
[86842.962401] ? arch_exit_to_user_mode_prepare.isra.0+0x1a/0xe0
[86842.962405] ? irqentry_exit_to_user_mode+0x38/0x1e0
[86842.962408] ? irqentry_exit+0x43/0x50
[86842.962409] ? exc_page_fault+0x94/0x1b0
[86842.962410] entry_SYSCALL_64_after_hwframe+0x78/0x80
[86842.962414] RIP: 0033:0x70b162f1bf4e
[86842.962431] Code: 6e 0e 00 ba ff ff ff ff 64 c7 00 16 00 00 00 e9 b9 fd ff ff e8 83 bf 01 00 0f 1f 00 f3 0f 1e fa 41 89 ca b8 4c 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 2a 89 c1 85 c0 74 0f 48 8b 05 95 6e 0e 00 64
[86842.962432] RSP: 002b:00007ffcc453b418 EFLAGS: 00000246 ORIG_RAX: 000000000000014c
[86842.962434] RAX: ffffffffffffffda RBX: 0000000000000900 RCX: 000070b162f1bf4e
[86842.962434] RDX: 0000000000000900 RSI: 00007ffcc453c7a8 RDI: 00000000ffffff9c
[86842.962435] RBP: 00007ffcc453b680 R08: 00007ffcc453b540 R09: 0000000000000007
[86842.962435] R10: 0000000000000fff R11: 0000000000000246 R12: 0000000000000fff
[86842.962436] R13: 00007ffcc453c7a8 R14: 000063b87d53e6f5 R15: 000063b85d80b5e0
[86842.962437] </TASK>
After unmounting and remounting a simplefs image, looking up a name in a directory that has had a file created in it causes a kernel soft-lockup. The accessing process is stuck in uninterruptible (D) state, the mount is wedged, and a reboot is required.
dmesg shows: