====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.1.967/8629 is trying to acquire lock: ffff88807e972170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 but task is already holding lock: ffff88807e970c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_change_inode_journal_flag+0x186/0x710 fs/ext4/inode.c:6134 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (&sbi->s_writepages_rwsem){++++}-{0:0}: percpu_down_read+0x46/0x1b0 include/linux/percpu-rwsem.h:51 ext4_writepages+0x213/0x2d40 fs/ext4/inode.c:2691 do_writepages+0x493/0x700 mm/page-writeback.c:2386 filemap_fdatawrite_wbc+0x1eb/0x240 mm/filemap.c:400 __filemap_fdatawrite_range mm/filemap.c:433 [inline] filemap_write_and_wait_range+0x126/0x3b0 mm/filemap.c:704 __iomap_dio_rw+0x784/0x1ba0 fs/iomap/direct-io.c:561 iomap_dio_rw+0x38/0x90 fs/iomap/direct-io.c:676 ext4_dio_read_iter fs/ext4/file.c:77 [inline] ext4_file_read_iter+0x565/0x6f0 fs/ext4/file.c:128 call_read_iter include/linux/fs.h:2173 [inline] generic_file_splice_read+0x3ed/0x5f0 fs/splice.c:311 do_splice_to fs/splice.c:807 [inline] splice_direct_to_actor+0x41f/0xc00 fs/splice.c:881 do_splice_direct+0x1d4/0x2f0 fs/splice.c:1008 do_sendfile+0x524/0xe30 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64+0x141/0x1a0 fs/read_write.c:1303 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #2 (&sb->s_type->i_mutex_key#9){++++}-{3:3}: down_read+0x44/0x2e0 kernel/locking/rwsem.c:1498 inode_lock_shared include/linux/fs.h:803 [inline] ext4_bmap+0x4f/0x3f0 fs/ext4/inode.c:3166 bmap+0xa2/0xd0 fs/inode.c:1820 jbd2_journal_bmap fs/jbd2/journal.c:981 [inline] __jbd2_journal_erase fs/jbd2/journal.c:1795 [inline] jbd2_journal_flush+0x7e0/0xcd0 fs/jbd2/journal.c:2517 ext4_ioctl_checkpoint fs/ext4/ioctl.c:856 [inline] __ext4_ioctl fs/ext4/ioctl.c:1282 [inline] ext4_ioctl+0x31f7/0x3840 fs/ext4/ioctl.c:1291 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #1 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 mutex_lock_io_nested+0x43/0x60 kernel/locking/mutex.c:777 jbd2_journal_flush+0x285/0xcd0 fs/jbd2/journal.c:2489 ocfs2_journal_shutdown+0x41f/0xb00 fs/ocfs2/journal.c:1044 ocfs2_dismount_volume+0x1f9/0x890 fs/ocfs2/super.c:1892 generic_shutdown_super+0x130/0x300 fs/super.c:475 kill_block_super+0x7c/0xe0 fs/super.c:1438 deactivate_locked_super+0x93/0xf0 fs/super.c:335 cleanup_mnt+0x426/0x4d0 fs/namespace.c:1148 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:184 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:217 __syscall_exit_to_user_mode_work kernel/entry/common.c:299 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:310 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 -> #0 (&journal->j_barrier){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5625 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 ext4_change_inode_journal_flag+0x18e/0x710 fs/ext4/inode.c:6135 ext4_ioctl_setflags fs/ext4/ioctl.c:448 [inline] ext4_fileattr_set+0xe61/0x1750 fs/ext4/ioctl.c:772 vfs_fileattr_set+0x859/0xb10 fs/ioctl.c:700 ioctl_setflags fs/ioctl.c:732 [inline] do_vfs_ioctl+0x1881/0x1f40 fs/ioctl.c:843 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 other info that might help us debug this: Chain exists of: &journal->j_barrier --> &sb->s_type->i_mutex_key#9 --> &sbi->s_writepages_rwsem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&sbi->s_writepages_rwsem); lock(&sb->s_type->i_mutex_key#9); lock(&sbi->s_writepages_rwsem); lock(&journal->j_barrier); *** DEADLOCK *** 4 locks held by syz.1.967/8629: #0: ffff88807e92e460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write_file+0x5c/0x200 fs/namespace.c:430 #1: ffff888140888de8 (&type->i_mutex_dir_key#4){++++}-{3:3}, at: inode_lock include/linux/fs.h:793 [inline] #1: ffff888140888de8 (&type->i_mutex_dir_key#4){++++}-{3:3}, at: vfs_fileattr_set+0x150/0xb10 fs/ioctl.c:685 #2: ffff888140888f88 (mapping.invalidate_lock){++++}-{3:3}, at: filemap_invalidate_lock include/linux/fs.h:838 [inline] #2: ffff888140888f88 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_change_inode_journal_flag+0x107/0x710 fs/ext4/inode.c:6126 #3: ffff88807e970c58 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_change_inode_journal_flag+0x186/0x710 fs/ext4/inode.c:6134 stack backtrace: CPU: 1 PID: 8629 Comm: syz.1.967 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026 Call Trace: dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2133 check_prev_add kernel/locking/lockdep.c:3053 [inline] check_prevs_add kernel/locking/lockdep.c:3172 [inline] validate_chain kernel/locking/lockdep.c:3788 [inline] __lock_acquire+0x2c66/0x7b50 kernel/locking/lockdep.c:5012 lock_acquire+0x19e/0x400 kernel/locking/lockdep.c:5625 __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596 __mutex_lock kernel/locking/mutex.c:729 [inline] mutex_lock_nested+0x17/0x20 kernel/locking/mutex.c:743 jbd2_journal_lock_updates+0x2ce/0x390 fs/jbd2/transaction.c:905 ext4_change_inode_journal_flag+0x18e/0x710 fs/ext4/inode.c:6135 ext4_ioctl_setflags fs/ext4/ioctl.c:448 [inline] ext4_fileattr_set+0xe61/0x1750 fs/ext4/ioctl.c:772 vfs_fileattr_set+0x859/0xb10 fs/ioctl.c:700 ioctl_setflags fs/ioctl.c:732 [inline] do_vfs_ioctl+0x1881/0x1f40 fs/ioctl.c:843 __do_sys_ioctl fs/ioctl.c:872 [inline] __se_sys_ioctl+0x83/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f196e05a159 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f196c2b2028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f196e2e1fa0 RCX: 00007f196e05a159 RDX: 0000200000000200 RSI: 0000000040086602 RDI: 0000000000000006 RBP: 00007f196e0f106b R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f196e2e2038 R14: 00007f196e2e1fa0 R15: 00007fff50e541d8