loop2: detected capacity change from 0 to 4096 ntfs: volume version 3.1. ====================================================== WARNING: possible circular locking dependency detected 6.7.0-rc5-syzkaller-00230-g3b8a9b2e6809 #0 Not tainted ------------------------------------------------------ syz-executor.2/27831 is trying to acquire lock: ffff888050e22790 (&ni->mrec_lock){+.+.}-{3:3}, at: map_mft_record+0x4a/0x730 fs/ntfs/mft.c:154 but task is already holding lock: ffff888050e22700 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x25e/0x3840 fs/ntfs/attrib.c:2001 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&rl->lock){++++}-{3:3}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1526 ntfs_read_block fs/ntfs/aops.c:242 [inline] ntfs_read_folio+0x1a98/0x2430 fs/ntfs/aops.c:430 filemap_read_folio+0xe9/0x2c0 mm/filemap.c:2323 do_read_cache_folio+0x205/0x540 mm/filemap.c:3691 do_read_cache_page mm/filemap.c:3757 [inline] read_cache_page+0x5b/0x160 mm/filemap.c:3766 read_mapping_page include/linux/pagemap.h:871 [inline] ntfs_map_page fs/ntfs/aops.h:75 [inline] ntfs_sync_mft_mirror+0x242/0x1ed0 fs/ntfs/mft.c:480 write_mft_record_nolock+0x1977/0x1da0 fs/ntfs/mft.c:787 write_mft_record+0x14b/0x380 fs/ntfs/mft.h:95 __ntfs_write_inode+0x91b/0xc30 fs/ntfs/inode.c:3052 write_inode fs/fs-writeback.c:1473 [inline] __writeback_single_inode+0xa91/0xe90 fs/fs-writeback.c:1690 writeback_sb_inodes+0x599/0x1080 fs/fs-writeback.c:1916 wb_writeback+0x2a5/0xaa0 fs/fs-writeback.c:2092 wb_do_writeback fs/fs-writeback.c:2239 [inline] wb_workfn+0x29c/0xfe0 fs/fs-writeback.c:2279 process_one_work+0x886/0x15d0 kernel/workqueue.c:2627 process_scheduled_works kernel/workqueue.c:2700 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2781 kthread+0x2c6/0x3a0 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242 -> #0 (&ni->mrec_lock){+.+.}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747 map_mft_record+0x4a/0x730 fs/ntfs/mft.c:154 ntfs_attr_extend_allocation+0x268/0x3840 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline] ntfs_file_write_iter+0xaa0/0x2070 fs/ntfs/file.c:1907 call_write_iter include/linux/fs.h:2020 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x64f/0xdf0 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __x64_sys_pwrite64+0x1fa/0x250 fs/read_write.c:706 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rl->lock); lock(&ni->mrec_lock); lock(&rl->lock); lock(&ni->mrec_lock); *** DEADLOCK *** 3 locks held by syz-executor.2/27831: #0: ffff888037fd8418 (sb_writers#27){.+.+}-{0:0}, at: ksys_pwrite64 fs/read_write.c:699 [inline] #0: ffff888037fd8418 (sb_writers#27){.+.+}-{0:0}, at: __do_sys_pwrite64 fs/read_write.c:709 [inline] #0: ffff888037fd8418 (sb_writers#27){.+.+}-{0:0}, at: __se_sys_pwrite64 fs/read_write.c:706 [inline] #0: ffff888037fd8418 (sb_writers#27){.+.+}-{0:0}, at: __x64_sys_pwrite64+0x1fa/0x250 fs/read_write.c:706 #1: ffff888050e22a70 (&sb->s_type->i_mutex_key#34){+.+.}-{3:3}, at: inode_lock include/linux/fs.h:802 [inline] #1: ffff888050e22a70 (&sb->s_type->i_mutex_key#34){+.+.}-{3:3}, at: ntfs_file_write_iter+0x78/0x2070 fs/ntfs/file.c:1905 #2: ffff888050e22700 (&rl->lock){++++}-{3:3}, at: ntfs_attr_extend_allocation+0x25e/0x3840 fs/ntfs/attrib.c:2001 stack backtrace: CPU: 0 PID: 27831 Comm: syz-executor.2 Not tainted 6.7.0-rc5-syzkaller-00230-g3b8a9b2e6809 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 check_noncircular+0x317/0x400 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3869 [inline] __lock_acquire+0x2433/0x3b20 kernel/locking/lockdep.c:5137 lock_acquire kernel/locking/lockdep.c:5754 [inline] lock_acquire+0x1ae/0x520 kernel/locking/lockdep.c:5719 __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x175/0x9d0 kernel/locking/mutex.c:747 map_mft_record+0x4a/0x730 fs/ntfs/mft.c:154 ntfs_attr_extend_allocation+0x268/0x3840 fs/ntfs/attrib.c:2002 ntfs_prepare_file_for_write fs/ntfs/file.c:391 [inline] ntfs_file_write_iter+0xaa0/0x2070 fs/ntfs/file.c:1907 call_write_iter include/linux/fs.h:2020 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x64f/0xdf0 fs/read_write.c:584 ksys_pwrite64 fs/read_write.c:699 [inline] __do_sys_pwrite64 fs/read_write.c:709 [inline] __se_sys_pwrite64 fs/read_write.c:706 [inline] __x64_sys_pwrite64+0x1fa/0x250 fs/read_write.c:706 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0x40/0x110 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f3ad907cba9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3ad9e4d0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 RAX: ffffffffffffffda RBX: 00007f3ad919bf80 RCX: 00007f3ad907cba9 RDX: 000000000000fdef RSI: 0000000020000240 RDI: 0000000000000004 RBP: 00007f3ad90c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f3ad919bf80 R15: 00007fffaff62168 ntfs: (device loop2): ntfs_cluster_alloc(): Failed to map page. ntfs: (device loop2): ntfs_cluster_alloc(): Failed to allocate clusters, aborting (error -4).