(syz-executor560,4250,0):ocfs2_block_check_validate:402 ERROR: CRC32 failed: stored: 0xb3775c19, computed 0x2dd1c265. Applying ECC.
JBD2: Ignoring recovery information on journal
ocfs2: Mounting device (7,0) on (node local, slot 0) with ordered data mode.
======================================================
WARNING: possible circular locking dependency detected
6.1.138-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor560/4250 is trying to acquire lock:
ffff88807e077938 ((wq_completion)ocfs2_wq){+.+.}-{0:0}, at: __flush_workqueue+0x124/0x1380 kernel/workqueue.c:2812

but task is already holding lock:
ffff8880731d20e0 (&type->s_umount_key#45){++++}-{3:3}, at: deactivate_super+0xa0/0xd0 fs/super.c:362

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #2 (&type->s_umount_key#45){++++}-{3:3}:
       down_read+0x42/0x2d0 kernel/locking/rwsem.c:1520
       ocfs2_finish_quota_recovery+0x129/0x1e40 fs/ocfs2/quota_local.c:600
       ocfs2_complete_recovery+0x157c/0x23a0 fs/ocfs2/journal.c:1324
       process_one_work+0x898/0x1160 kernel/workqueue.c:2292
       worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
       kthread+0x29d/0x330 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #1 ((work_completion)(&journal->j_recovery_work)){+.+.}-{0:0}:
       process_one_work+0x7d9/0x1160 kernel/workqueue.c:2268
       worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439
       kthread+0x29d/0x330 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #0 ((wq_completion)ocfs2_wq){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3090 [inline]
       check_prevs_add kernel/locking/lockdep.c:3209 [inline]
       validate_chain kernel/locking/lockdep.c:3825 [inline]
       __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
       lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
       __flush_workqueue+0x13d/0x1380 kernel/workqueue.c:2812
       ocfs2_shutdown_local_alloc+0xe4/0xa10 fs/ocfs2/localalloc.c:379
       ocfs2_dismount_volume+0x1f4/0x920 fs/ocfs2/super.c:1879
       generic_shutdown_super+0x130/0x340 fs/super.c:501
       kill_block_super+0x7c/0xe0 fs/super.c:1470
       deactivate_locked_super+0x93/0xf0 fs/super.c:332
       cleanup_mnt+0x463/0x4f0 fs/namespace.c:1186
       task_work_run+0x1ca/0x250 kernel/task_work.c:203
       exit_task_work include/linux/task_work.h:39 [inline]
       do_exit+0x936/0x2400 kernel/exit.c:871
       do_group_exit+0x217/0x2d0 kernel/exit.c:1021
       __do_sys_exit_group kernel/exit.c:1032 [inline]
       __se_sys_exit_group kernel/exit.c:1030 [inline]
       __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030
       do_syscall_x64 arch/x86/entry/common.c:51 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

Chain exists of:
  (wq_completion)ocfs2_wq --> (work_completion)(&journal->j_recovery_work) --> &type->s_umount_key#45

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&type->s_umount_key#45);
                               lock((work_completion)(&journal->j_recovery_work));
                               lock(&type->s_umount_key#45);
  lock((wq_completion)ocfs2_wq);

 *** DEADLOCK ***

1 lock held by syz-executor560/4250:
 #0: ffff8880731d20e0 (&type->s_umount_key#45){++++}-{3:3}, at: deactivate_super+0xa0/0xd0 fs/super.c:362

stack backtrace:
CPU: 0 PID: 4250 Comm: syz-executor560 Not tainted 6.1.138-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 check_noncircular+0x274/0x310 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3090 [inline]
 check_prevs_add kernel/locking/lockdep.c:3209 [inline]
 validate_chain kernel/locking/lockdep.c:3825 [inline]
 __lock_acquire+0x2cf8/0x7c50 kernel/locking/lockdep.c:5049
 lock_acquire+0x1b4/0x490 kernel/locking/lockdep.c:5662
 __flush_workqueue+0x13d/0x1380 kernel/workqueue.c:2812
 ocfs2_shutdown_local_alloc+0xe4/0xa10 fs/ocfs2/localalloc.c:379
 ocfs2_dismount_volume+0x1f4/0x920 fs/ocfs2/super.c:1879
 generic_shutdown_super+0x130/0x340 fs/super.c:501
 kill_block_super+0x7c/0xe0 fs/super.c:1470
 deactivate_locked_super+0x93/0xf0 fs/super.c:332
 cleanup_mnt+0x463/0x4f0 fs/namespace.c:1186
 task_work_run+0x1ca/0x250 kernel/task_work.c:203
 exit_task_work include/linux/task_work.h:39 [inline]
 do_exit+0x936/0x2400 kernel/exit.c:871
 do_group_exit+0x217/0x2d0 kernel/exit.c:1021
 __do_sys_exit_group kernel/exit.c:1032 [inline]
 __se_sys_exit_group kernel/exit.c:1030 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1030
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f400eb89c09
Code: Unable to access opcode bytes at 0x7f400eb89bdf.
RSP: 002b:00007ffec9f7e7d8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f400eb89c09
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 00007f400ec0a2b0 R08: ffffffffffffffb8 R09: 0000000000004701
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f400ec0a2b0
R13: 0000000000000000 R14: 00007f400ec0b020 R15: 00007f400eb58130
 </TASK>
ocfs2: Unmounting device (7,0) on (node local)