NILFS (loop1): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop1): nilfs_bmap_lookup_contig: broken bmap (inode number=16) ====================================================== WARNING: possible circular locking dependency detected 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Not tainted ------------------------------------------------------ syz-executor.1/24564 is trying to acquire lock: ffff0001275a3890 (&nilfs->ns_sem){++++}-{3:3}, at: nilfs_set_error fs/nilfs2/super.c:92 [inline] ffff0001275a3890 (&nilfs->ns_sem){++++}-{3:3}, at: __nilfs_error+0xb4/0x284 fs/nilfs2/super.c:137 but task is already holding lock: ffff00010df06e70 (&dat_lock_key){.+.+}-{3:3}, at: nilfs_get_block+0x64/0x364 fs/nilfs2/inode.c:84 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&dat_lock_key){.+.+}-{3:3}: down_read+0x5c/0x78 kernel/locking/rwsem.c:1499 nilfs_count_free_blocks+0x2c/0x6c fs/nilfs2/the_nilfs.c:693 nilfs_set_log_cursor fs/nilfs2/super.c:236 [inline] nilfs_cleanup_super+0x118/0x1f0 fs/nilfs2/super.c:318 load_nilfs+0x414/0x668 fs/nilfs2/the_nilfs.c:315 nilfs_fill_super+0x10c/0x2f8 fs/nilfs2/super.c:1059 nilfs_mount+0x370/0x52c fs/nilfs2/super.c:1317 legacy_get_tree+0x30/0x74 fs/fs_context.c:610 vfs_get_tree+0x40/0x140 fs/super.c:1530 do_new_mount+0x1dc/0x4e4 fs/namespace.c:3040 path_mount+0x358/0x914 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __arm64_sys_mount+0x2c4/0x3c4 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 -> #0 (&nilfs->ns_sem){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 down_write+0x5c/0xcc kernel/locking/rwsem.c:1552 nilfs_set_error fs/nilfs2/super.c:92 [inline] __nilfs_error+0xb4/0x284 fs/nilfs2/super.c:137 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_contig+0x98/0xc0 fs/nilfs2/bmap.c:95 nilfs_get_block+0x7c/0x364 fs/nilfs2/inode.c:85 block_truncate_page+0x1b4/0xab4 fs/buffer.c:2583 nilfs_truncate+0xb8/0x178 fs/nilfs2/inode.c:857 nilfs_setattr+0xf8/0x164 fs/nilfs2/inode.c:955 notify_change+0x758/0x7f0 fs/attr.c:420 do_truncate+0x108/0x150 fs/open.c:65 vfs_truncate+0x1dc/0x24c fs/open.c:111 do_sys_truncate+0x94/0x140 fs/open.c:134 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x20/0x30 fs/open.c:144 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&dat_lock_key); lock(&nilfs->ns_sem); lock(&dat_lock_key); lock(&nilfs->ns_sem); *** DEADLOCK *** 5 locks held by syz-executor.1/24564: #0: ffff00011abe8460 (sb_writers#24){.+.+}-{0:0}, at: mnt_want_write+0x20/0x64 fs/namespace.c:393 #1: ffff00010e6d3818 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #1: ffff00010e6d3818 (&sb->s_type->i_mutex_key#28){+.+.}-{3:3}, at: do_truncate+0xf4/0x150 fs/open.c:63 #2: ffff00011abe8650 (sb_internal#3){.+.+}-{0:0}, at: nilfs_setattr+0x84/0x164 fs/nilfs2/inode.c:947 #3: ffff0001275a3aa0 (&nilfs->ns_segctor_sem){++++}-{3:3}, at: nilfs_transaction_begin+0x214/0x384 fs/nilfs2/segment.c:223 #4: ffff00010df06e70 (&dat_lock_key){.+.+}-{3:3}, at: nilfs_get_block+0x64/0x364 fs/nilfs2/inode.c:84 stack backtrace: CPU: 1 PID: 24564 Comm: syz-executor.1 Not tainted 6.0.0-rc7-syzkaller-18095-gbbed346d5a96 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/30/2022 Call trace: dump_backtrace+0x1c4/0x1f0 arch/arm64/kernel/stacktrace.c:156 show_stack+0x2c/0x54 arch/arm64/kernel/stacktrace.c:163 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x104/0x16c lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_circular_bug+0x2c4/0x2c8 kernel/locking/lockdep.c:2053 check_noncircular+0x14c/0x154 kernel/locking/lockdep.c:2175 check_prev_add kernel/locking/lockdep.c:3095 [inline] check_prevs_add kernel/locking/lockdep.c:3214 [inline] validate_chain kernel/locking/lockdep.c:3829 [inline] __lock_acquire+0x1530/0x30a4 kernel/locking/lockdep.c:5053 lock_acquire+0x100/0x1f8 kernel/locking/lockdep.c:5666 down_write+0x5c/0xcc kernel/locking/rwsem.c:1552 nilfs_set_error fs/nilfs2/super.c:92 [inline] __nilfs_error+0xb4/0x284 fs/nilfs2/super.c:137 nilfs_bmap_convert_error fs/nilfs2/bmap.c:35 [inline] nilfs_bmap_lookup_contig+0x98/0xc0 fs/nilfs2/bmap.c:95 nilfs_get_block+0x7c/0x364 fs/nilfs2/inode.c:85 block_truncate_page+0x1b4/0xab4 fs/buffer.c:2583 nilfs_truncate+0xb8/0x178 fs/nilfs2/inode.c:857 nilfs_setattr+0xf8/0x164 fs/nilfs2/inode.c:955 notify_change+0x758/0x7f0 fs/attr.c:420 do_truncate+0x108/0x150 fs/open.c:65 vfs_truncate+0x1dc/0x24c fs/open.c:111 do_sys_truncate+0x94/0x140 fs/open.c:134 __do_sys_truncate fs/open.c:146 [inline] __se_sys_truncate fs/open.c:144 [inline] __arm64_sys_truncate+0x20/0x30 fs/open.c:144 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall arch/arm64/kernel/syscall.c:52 [inline] el0_svc_common+0x138/0x220 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x48/0x164 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x150 arch/arm64/kernel/entry-common.c:636 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:654 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 Remounting filesystem read-only NILFS (loop1): bad btree node (ino=16, blocknr=15): level = 0, flags = 0x0, nchildren = 0 NILFS error (device loop1): nilfs_bmap_last_key: broken bmap (inode number=16) NILFS (loop1): error -5 truncating bmap (ino=16)