====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc3-next-20230109 #1 Not tainted ------------------------------------------------------ syz-executor.0/62006 is trying to acquire lock: ffff88800cd9e3f8 (&journal->j_checkpoint_mutex){+.+.}-{3:3}, at: __jbd2_log_wait_for_space+0x238/0x460 but task is already holding lock: ffff88800cd9a530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (sb_pagefaults){.+.+}-{0:0}: ext4_page_mkwrite+0x1fc/0x1ab0 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x3640 handle_mm_fault+0x1b8/0x860 do_user_addr_fault+0x53a/0x1300 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 -> #2 (&mm->mmap_lock){++++}-{3:3}: internal_get_user_pages_fast+0x138a/0x2d60 get_user_pages_fast+0x6a/0xa0 __iov_iter_get_pages_alloc+0x39f/0x2310 iov_iter_get_pages+0xb0/0x110 bio_iov_iter_get_pages+0x2a1/0x1070 iomap_dio_bio_iter+0xa8b/0x14a0 __iomap_dio_rw+0xe10/0x1bf0 iomap_dio_rw+0x40/0xa0 ext4_file_write_iter+0xb5d/0x1930 vfs_write+0x9c7/0xdd0 ksys_write+0x12b/0x260 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #1 (&sb->s_type->i_mutex_key#6){++++}-{3:3}: down_read+0x9c/0x450 ext4_bmap+0x52/0x470 bmap+0xb0/0x130 jbd2_journal_bmap+0xac/0x190 jbd2_journal_flush+0x857/0xc10 __ext4_ioctl+0x9db/0x43d0 __x64_sys_ioctl+0x19e/0x210 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #0 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: __lock_acquire+0x2999/0x5e00 lock_acquire.part.0+0x11e/0x340 mutex_lock_io_nested+0x14c/0x1330 __jbd2_log_wait_for_space+0x238/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x394/0x6b0 __ext4_journal_start_sb+0x4c2/0x6f0 ext4_dirty_inode+0xa5/0x130 __mark_inode_dirty+0x1aa/0xee0 generic_update_time+0x21b/0x2b0 file_update_time+0x22f/0x280 ext4_page_mkwrite+0x2ee/0x1ab0 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x3640 handle_mm_fault+0x1b8/0x860 do_user_addr_fault+0x53a/0x1300 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 other info that might help us debug this: Chain exists of: &journal->j_checkpoint_mutex --> &mm->mmap_lock --> sb_pagefaults Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(sb_pagefaults); lock(&mm->mmap_lock); lock(sb_pagefaults); lock(&journal->j_checkpoint_mutex); *** DEADLOCK *** 2 locks held by syz-executor.0/62006: #0: ffff8880364f3ed8 (&mm->mmap_lock){++++}-{3:3}, at: do_user_addr_fault+0x33b/0x1300 #1: ffff88800cd9a530 (sb_pagefaults){.+.+}-{0:0}, at: do_page_mkwrite+0x1a0/0x640 stack backtrace: CPU: 1 PID: 62006 Comm: syz-executor.0 Not tainted 6.2.0-rc3-next-20230109 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Call Trace: dump_stack_lvl+0x8f/0xb7 check_noncircular+0x263/0x2e0 __lock_acquire+0x2999/0x5e00 lock_acquire.part.0+0x11e/0x340 mutex_lock_io_nested+0x14c/0x1330 __jbd2_log_wait_for_space+0x238/0x460 add_transaction_credits+0xa42/0xb80 start_this_handle+0x3ac/0x14c0 jbd2__journal_start+0x394/0x6b0 __ext4_journal_start_sb+0x4c2/0x6f0 ext4_dirty_inode+0xa5/0x130 __mark_inode_dirty+0x1aa/0xee0 generic_update_time+0x21b/0x2b0 file_update_time+0x22f/0x280 ext4_page_mkwrite+0x2ee/0x1ab0 do_page_mkwrite+0x1a0/0x640 __handle_mm_fault+0x12ac/0x3640 handle_mm_fault+0x1b8/0x860 do_user_addr_fault+0x53a/0x1300 exc_page_fault+0x9c/0x1a0 asm_exc_page_fault+0x26/0x30 RIP: 0033:0x7fc0817ae673 Code: 5d c3 0f 1f 44 00 00 48 8b 0d 59 ed 0a 01 48 8b 05 4a ed 0a 01 4c 8d 81 00 00 00 01 48 39 c8 72 13 4c 39 c0 73 0e 48 8d 50 04 <89> 38 48 89 15 2c ed 0a 01 c3 52 48 8d 35 77 b7 0b 00 48 89 c2 48 RSP: 002b:00007fffa596d848 EFLAGS: 00010287 RAX: 0000001b30b22000 RBX: 00007fc081588008 RCX: 0000001b30b20000 RDX: 0000001b30b22004 RSI: ffffffff838069ae RDI: 00000000efdea031 RBP: 0000000000000001 R08: 0000001b31b20000 R09: 0000001b30b21c24 R10: 0000000000000031 R11: 00000000efdea035 R12: 000000000000031b R13: 00007fc081918000 R14: ffffffff838069ae R15: 00007fc081923ff0 loop7: detected capacity change from 0 to 106 audit: type=1326 audit(2000000471.363:41): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62008 comm="syz-executor.3" exe="/syz-executor.3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f93c9ca1b19 code=0x0 isofs_fill_super: bread failed, dev=loop7, iso_blknum=27, block=54 audit: type=1326 audit(2000000472.196:42): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62008 comm="syz-executor.3" exe="/syz-executor.3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f93c9ca1b19 code=0x0 audit: type=1326 audit(2000000472.492:43): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62090 comm="syz-executor.3" exe="/syz-executor.3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f93c9ca1b19 code=0x0 audit: type=1326 audit(2000000473.396:44): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62157 comm="syz-executor.3" exe="/syz-executor.3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f93c9ca1b19 code=0x0 audit: type=1326 audit(2000000474.320:45): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62163 comm="syz-executor.4" exe="/syz-executor.4" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f24d2880b19 code=0x0 audit: type=1326 audit(2000000474.389:46): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62177 comm="syz-executor.3" exe="/syz-executor.3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f93c9ca1b19 code=0x0 audit: type=1326 audit(2000000475.336:47): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62298 comm="syz-executor.4" exe="/syz-executor.4" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f24d2880b19 code=0x0 audit: type=1326 audit(2000000476.429:48): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=62367 comm="syz-executor.4" exe="/syz-executor.4" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f24d2880b19 code=0x0 loop6: detected capacity change from 0 to 40 loop6: detected capacity change from 0 to 40 loop6: detected capacity change from 0 to 40 loop7: detected capacity change from 0 to 40 loop6: detected capacity change from 0 to 40