Re: [PATCH] ocfs2: fix circular locking dependency in ocfs2_acquire_dquot
From: Andrew Morton
Date: Mon Jan 05 2026 - 20:51:59 EST
On Sat, 27 Dec 2025 18:42:51 +0100 Szymon Wilczek <swilczek.lx@xxxxxxxxx> wrote:
> Move ocfs2_extend_no_holes() to execute before ocfs2_lock_global_qf() to
> fix a circular locking dependency reported by syzbot.
>
> The issue occurs because ocfs2_extend_no_holes() internally calls
> ocfs2_extend_allocation() which starts a transaction (acquiring
> sb_start_intwrite). When called while holding the global quota file
> lock, this conflicts with mount-time operations that acquire
> sb_internal first, creating the following circular dependency:
>
> sb_internal -> ocfs2_sysfile_lock_key -> ocfs2_quota_ip_alloc_sem_key
>
> By moving the quota file extension before acquiring the global quota
> file lock, we ensure that any internal transactions complete before
> quota locks are held, breaking the circular dependency.
Thanks. This might have escaped reviewer attention due to the holiday
season. I'll add it to mm.git's mm-nonmm-unstable branch for runtime
testing while we await review (please!).