[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJRoVwiBkZj1Xor7izsWkFyCK=kXjTmqP+PU4Znz+FORghcAzA@mail.gmail.com>
Date: Wed, 21 Jan 2026 00:16:21 +0100
From: Szymon Wilczek <swilczek.lx@...il.com>
To: Joseph Qi <joseph.qi@...ux.alibaba.com>
Cc: ocfs2-devel@...ts.linux.dev, mark@...heh.com, jlbec@...lplan.org,
linux-kernel@...r.kernel.org, syzkaller-bugs@...glegroups.com,
syzbot+51244a05705883616c95@...kaller.appspotmail.com,
akpm <akpm@...ux-foundation.org>
Subject: Re: [PATCH] ocfs2: fix circular locking dependency in ocfs2_acquire_dquot
Hi Joseph,
You are absolutely correct. Since ocfs2_disable_quotas() completes before
ocfs2_shutdown_local_alloc(), these two specific paths likely cannot race
at runtime.
However, the Lockdep report is based on lock classes, not just runtime
concurrency.
1. The shutdown path (ocfs2_shutdown_local_alloc) teaches Lockdep:
sb_internal -> ocfs2_sysfile_lock_key (on Local Alloc inode)
2. The acquire path (ocfs2_acquire_dquot) teaches Lockdep:
ocfs2_sysfile_lock_key (on Quota inode) -> sb_internal
Because both inodes use the same lock class (ocfs2_sysfile_lock_key),
Lockdep sees a contradiction:
sb_internal -> sysfile -> sb_internal
Even if they don't race, this inconsistent ordering is a violation
that Lockdep flags. Fixing the order in acquire_dquot resolves this
contradiction and ensures sb_internal (freeze protection) is always
taken outermost.
Thanks,
Szymon
Powered by blists - more mailing lists