====================================================== WARNING: possible circular locking dependency detected 6.14.0-rc6-syzkaller-00180-g83158b21ae9a #0 Not tainted ------------------------------------------------------ syz.0.0/5320 is trying to acquire lock: ffff88804552d100 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] ffff88804552d100 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{4:4}, at: __ocfs2_flush_truncate_log+0x388/0x1240 fs/ocfs2/alloc.c:6046 but task is already holding lock: ffff88804553b480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] ffff88804553b480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6075 [inline] ffff88804553b480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: ocfs2_try_to_free_truncate_log+0x1b3/0x410 fs/ocfs2/alloc.c:6135 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}: lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:877 [inline] ocfs2_move_extent fs/ocfs2/move_extents.c:640 [inline] __ocfs2_move_extents_range+0x1f0b/0x4440 fs/ocfs2/move_extents.c:860 ocfs2_move_extents+0x3ee/0xac0 fs/ocfs2/move_extents.c:927 ocfs2_ioctl_move_extents+0x61a/0x830 fs/ocfs2/move_extents.c:1053 ocfs2_ioctl+0x196/0x7d0 fs/ocfs2/ioctl.c:946 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl+0xf5/0x170 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:877 [inline] __ocfs2_flush_truncate_log+0x388/0x1240 fs/ocfs2/alloc.c:6046 ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6076 [inline] ocfs2_try_to_free_truncate_log+0x1bb/0x410 fs/ocfs2/alloc.c:6135 ocfs2_write_begin_nolock+0x3a73/0x4e40 fs/ocfs2/aops.c:1855 ocfs2_write_begin+0x205/0x3a0 fs/ocfs2/aops.c:1889 generic_perform_write+0x346/0x990 mm/filemap.c:4188 ocfs2_file_write_iter+0x19af/0x2180 fs/ocfs2/file.c:2469 iter_file_splice_write+0xbfa/0x1510 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11b/0x220 fs/splice.c:1164 splice_direct_to_actor+0x586/0xc80 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x289/0x3e0 fs/splice.c:1233 do_sendfile+0x564/0x8a0 fs/read_write.c:1363 __do_sys_sendfile64 fs/read_write.c:1424 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1410 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5); lock(&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#4); *** DEADLOCK *** 4 locks held by syz.0.0/5320: #0: ffff888033e82420 (sb_writers#13){.+.+}-{0:0}, at: direct_splice_actor+0x49/0x220 fs/splice.c:1163 #1: ffff88804553d100 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] #1: ffff88804553d100 (&sb->s_type->i_mutex_key#20){+.+.}-{4:4}, at: ocfs2_file_write_iter+0x445/0x2180 fs/ocfs2/file.c:2399 #2: ffff88804553cda0 (&oi->ip_alloc_sem){++++}-{4:4}, at: ocfs2_write_begin+0x1d1/0x3a0 fs/ocfs2/aops.c:1887 #3: ffff88804553b480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:877 [inline] #3: ffff88804553b480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6075 [inline] #3: ffff88804553b480 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#5){+.+.}-{4:4}, at: ocfs2_try_to_free_truncate_log+0x1b3/0x410 fs/ocfs2/alloc.c:6135 stack backtrace: CPU: 0 UID: 0 PID: 5320 Comm: syz.0.0 Not tainted 6.14.0-rc6-syzkaller-00180-g83158b21ae9a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_circular_bug+0x13a/0x1b0 kernel/locking/lockdep.c:2076 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2208 check_prev_add kernel/locking/lockdep.c:3163 [inline] check_prevs_add kernel/locking/lockdep.c:3282 [inline] validate_chain+0x18ef/0x5920 kernel/locking/lockdep.c:3906 __lock_acquire+0x1397/0x2100 kernel/locking/lockdep.c:5228 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5851 down_write+0x99/0x220 kernel/locking/rwsem.c:1577 inode_lock include/linux/fs.h:877 [inline] __ocfs2_flush_truncate_log+0x388/0x1240 fs/ocfs2/alloc.c:6046 ocfs2_flush_truncate_log fs/ocfs2/alloc.c:6076 [inline] ocfs2_try_to_free_truncate_log+0x1bb/0x410 fs/ocfs2/alloc.c:6135 ocfs2_write_begin_nolock+0x3a73/0x4e40 fs/ocfs2/aops.c:1855 ocfs2_write_begin+0x205/0x3a0 fs/ocfs2/aops.c:1889 generic_perform_write+0x346/0x990 mm/filemap.c:4188 ocfs2_file_write_iter+0x19af/0x2180 fs/ocfs2/file.c:2469 iter_file_splice_write+0xbfa/0x1510 fs/splice.c:743 do_splice_from fs/splice.c:941 [inline] direct_splice_actor+0x11b/0x220 fs/splice.c:1164 splice_direct_to_actor+0x586/0xc80 fs/splice.c:1108 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x289/0x3e0 fs/splice.c:1233 do_sendfile+0x564/0x8a0 fs/read_write.c:1363 __do_sys_sendfile64 fs/read_write.c:1424 [inline] __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1410 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f836bf8d169 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f836ceb2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007f836c1a6080 RCX: 00007f836bf8d169 RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000007 RBP: 00007f836c00e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000087fffa0 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f836c1a6080 R15: 00007fff718703f8