Re: [PATCH] ocfs2: embed actual values into ocfs2_sysfile_lock_key names

From: Heming Zhao
Date: Mon Jun 30 2025 - 09:55:55 EST


On 6/30/25 18:39, Tetsuo Handa wrote:
On 2025/06/30 11:42, Heming Zhao wrote:
I am not familiar with lockdep, and just have two questions regarding
the lockdep in ocfs2.

1>
there are three global "static struct lock_class_key" definitions:
- fs/ocfs2/inode.c : ocfs2_sysfile_lock_key[NUM_SYSTEM_INODES]
- fs/ocfs2/dlmglue.c: lockdep_keys[OCFS2_NUM_LOCK_TYPES]
- fs/ocfs2/sysfile.c: ocfs2_sysfile_cluster_lock_key[NUM_SYSTEM_INODES]

why did you env only trigger the ocfs2_sysfile_lock_key[] warning?

Because syzbot is reporting lockdep warning on ocfs2_sysfile_lock_key
at https://syzkaller.appspot.com/bug?extid=68c788938ba0326046a9 and
I couldn't find which lock_class_key syzbot is reporting.

Unless you want me to update all keys within this patch, you can submit
similar changes on lockdep_keys and ocfs2_sysfile_cluster_lock_key as
separate patches.


2>
It seems the existing CONFIG_DEBUG_LOCK_ALLOC is incorrect, it should be
replaced with CONFIG_LOCKDEP.

I couldn't catch what you mean. There are many modules which declare
"struct lock_class_key" under CONFIG_DEBUG_LOCK_ALLOC=y.


I mean OCFS2 should use unified kernel configuration option.

- Heming