ocfs2: Mounting device (7,6) on (node local, slot 0) with ordered data mode. ====================================================== WARNING: possible circular locking dependency detected 6.12.0-syzkaller-07749-g28eb75e178d3 #0 Not tainted ------------------------------------------------------ syz.6.2043/11565 is trying to acquire lock: ffff88806d5d07e8 (&oi->ip_io_mutex){+.+.}-{4:4}, at: __ocfs2_journal_access+0x3f1/0x8b0 fs/ocfs2/journal.c:684 but task is already holding lock: ffff88804d012958 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xf6c/0x1430 fs/jbd2/transaction.c:448 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #6 (jbd2_handle){++++}-{0:0}: start_this_handle+0xf92/0x1430 fs/jbd2/transaction.c:448 jbd2__journal_start+0x394/0x6a0 fs/jbd2/transaction.c:505 __ext4_journal_start_sb+0x358/0x660 fs/ext4/ext4_jbd2.c:112 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0xa1/0x130 fs/ext4/inode.c:6038 __mark_inode_dirty+0x1f9/0xe60 fs/fs-writeback.c:2515 generic_update_time+0xcf/0xf0 fs/inode.c:2113 inode_update_time fs/inode.c:2126 [inline] touch_atime+0x4ee/0x5d0 fs/inode.c:2198 file_accessed include/linux/fs.h:2539 [inline] ext4_file_mmap+0x4fc/0x6b0 fs/ext4/file.c:816 call_mmap include/linux/fs.h:2183 [inline] mmap_file mm/internal.h:123 [inline] __mmap_region+0x1280/0x21c0 mm/mmap.c:1453 mmap_region+0x270/0x320 mm/mmap.c:1603 do_mmap+0xc00/0xfc0 mm/mmap.c:496 vm_mmap_pgoff+0x1ba/0x360 mm/util.c:588 ksys_mmap_pgoff+0x32c/0x5c0 mm/mmap.c:542 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:79 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:79 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #5 (&mm->mmap_lock){++++}-{4:4}: __might_fault mm/memory.c:6716 [inline] __might_fault+0x11b/0x190 mm/memory.c:6709 _inline_copy_from_user include/linux/uaccess.h:162 [inline] _copy_from_user+0x29/0xd0 lib/usercopy.c:18 copy_from_user include/linux/uaccess.h:212 [inline] __blk_trace_setup+0xa8/0x180 kernel/trace/blktrace.c:626 blk_trace_setup+0x47/0x70 kernel/trace/blktrace.c:648 sg_ioctl_common drivers/scsi/sg.c:1121 [inline] sg_ioctl+0x65e/0x2750 drivers/scsi/sg.c:1163 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #4 (&q->debugfs_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 blk_mq_init_sched+0x42b/0x640 block/blk-mq-sched.c:473 elevator_init_mq+0x2cd/0x420 block/elevator.c:610 add_disk_fwnode+0x113/0x1300 block/genhd.c:413 sd_probe+0xa86/0x1000 drivers/scsi/sd.c:4024 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x241/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x15a/0x1e0 drivers/base/bus.c:459 __device_attach_async_helper+0x1d3/0x290 drivers/base/dd.c:987 async_run_entry_fn+0x9f/0x530 kernel/async.c:129 process_one_work+0x9c8/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #3 (&q->q_usage_counter(queue)#50){++++}-{0:0}: blk_queue_enter+0x50f/0x640 block/blk-core.c:328 blk_mq_alloc_request+0x59b/0x950 block/blk-mq.c:652 scsi_alloc_request drivers/scsi/scsi_lib.c:1222 [inline] scsi_execute_cmd+0x1eb/0xf40 drivers/scsi/scsi_lib.c:304 read_capacity_16+0x213/0xe10 drivers/scsi/sd.c:2655 sd_read_capacity drivers/scsi/sd.c:2824 [inline] sd_revalidate_disk.isra.0+0x1a06/0xa8d0 drivers/scsi/sd.c:3734 sd_probe+0x904/0x1000 drivers/scsi/sd.c:4010 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x241/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x15a/0x1e0 drivers/base/bus.c:459 __device_attach_async_helper+0x1d3/0x290 drivers/base/dd.c:987 async_run_entry_fn+0x9f/0x530 kernel/async.c:129 process_one_work+0x9c8/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #2 (&q->limits_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 queue_limits_start_update include/linux/blkdev.h:945 [inline] loop_reconfigure_limits+0x2da/0x8d0 drivers/block/loop.c:1003 loop_set_block_size drivers/block/loop.c:1473 [inline] lo_simple_ioctl drivers/block/loop.c:1496 [inline] lo_ioctl+0x901/0x18b0 drivers/block/loop.c:1559 blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&q->q_usage_counter(io)#17){++++}-{0:0}: bio_queue_enter block/blk.h:75 [inline] blk_mq_submit_bio+0x1fc4/0x24c0 block/blk-mq.c:3092 __submit_bio+0x384/0x540 block/blk-core.c:629 __submit_bio_noacct_mq block/blk-core.c:710 [inline] submit_bio_noacct_nocheck+0x6fb/0xd70 block/blk-core.c:739 submit_bio_noacct+0x93a/0x1e10 block/blk-core.c:868 ocfs2_read_blocks+0x6b0/0x1530 fs/ocfs2/buffer_head_io.c:330 ocfs2_read_inode_block_full fs/ocfs2/inode.c:1593 [inline] ocfs2_read_inode_block+0xc6/0x170 fs/ocfs2/inode.c:1605 ocfs2_get_clusters+0x22b/0xc40 fs/ocfs2/extent_map.c:615 ocfs2_extent_map_get_blocks+0x1ac/0x640 fs/ocfs2/extent_map.c:668 ocfs2_read_virt_blocks+0x285/0x9c0 fs/ocfs2/extent_map.c:983 ocfs2_read_dir_block+0xb6/0x520 fs/ocfs2/dir.c:508 ocfs2_find_entry_el fs/ocfs2/dir.c:715 [inline] ocfs2_find_entry+0xc3b/0x17b0 fs/ocfs2/dir.c:1080 ocfs2_find_files_on_disk fs/ocfs2/dir.c:1981 [inline] ocfs2_lookup_ino_from_name+0xd5/0x1e0 fs/ocfs2/dir.c:2003 _ocfs2_get_system_file_inode fs/ocfs2/sysfile.c:136 [inline] ocfs2_get_system_file_inode+0x443/0x940 fs/ocfs2/sysfile.c:112 ocfs2_init_global_system_inodes fs/ocfs2/super.c:457 [inline] ocfs2_initialize_super.isra.0+0x1f48/0x32f0 fs/ocfs2/super.c:2248 ocfs2_fill_super+0xb1a/0x41d0 fs/ocfs2/super.c:994 mount_bdev+0x1e6/0x2d0 fs/super.c:1693 legacy_get_tree+0x10c/0x220 fs/fs_context.c:662 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&oi->ip_io_mutex){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 __ocfs2_journal_access+0x3f1/0x8b0 fs/ocfs2/journal.c:684 ocfs2_update_last_group_and_inode fs/ocfs2/resize.c:100 [inline] ocfs2_group_extend+0x768/0x1cb0 fs/ocfs2/resize.c:350 ocfs2_ioctl+0x182/0x6f0 fs/ocfs2/ioctl.c:873 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &oi->ip_io_mutex --> &mm->mmap_lock --> jbd2_handle Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(jbd2_handle); lock(&mm->mmap_lock); lock(jbd2_handle); lock(&oi->ip_io_mutex); *** DEADLOCK *** 5 locks held by syz.6.2043/11565: #0: ffff88807b502420 (sb_writers#18){.+.+}-{0:0}, at: ocfs2_ioctl+0x15d/0x6f0 fs/ocfs2/ioctl.c:870 #1: ffff88806d5d09c0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #1: ffff88806d5d09c0 (&ocfs2_sysfile_lock_key[args->fi_sysfile_type]#6){+.+.}-{4:4}, at: ocfs2_group_extend+0x240/0x1cb0 fs/ocfs2/resize.c:296 #2: ffff88807b502610 (sb_internal#4){.+.+}-{0:0}, at: ocfs2_group_extend+0x586/0x1cb0 fs/ocfs2/resize.c:342 #3: ffff888033ae10e8 (&journal->j_trans_barrier){.+.+}-{4:4}, at: ocfs2_start_trans+0x3ae/0x970 fs/ocfs2/journal.c:350 #4: ffff88804d012958 (jbd2_handle){++++}-{0:0}, at: start_this_handle+0xf6c/0x1430 fs/jbd2/transaction.c:448 stack backtrace: CPU: 1 UID: 0 PID: 11565 Comm: syz.6.2043 Not tainted 6.12.0-syzkaller-07749-g28eb75e178d3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/30/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x419/0x5d0 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 __ocfs2_journal_access+0x3f1/0x8b0 fs/ocfs2/journal.c:684 ocfs2_update_last_group_and_inode fs/ocfs2/resize.c:100 [inline] ocfs2_group_extend+0x768/0x1cb0 fs/ocfs2/resize.c:350 ocfs2_ioctl+0x182/0x6f0 fs/ocfs2/ioctl.c:873 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe07237e819 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:00007fe0730d2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fe072535fa0 RCX: 00007fe07237e819 RDX: 0000000020000080 RSI: 0000000040046f01 RDI: 0000000000000004 RBP: 00007fe0723f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fe072535fa0 R15: 00007fff6351c6b8