Re: [PATCH] ocfs2: fix circular locking dependency in reflink
From: Joseph Qi
Date: Sun Aug 02 2026 - 09:04:08 EST
On 8/1/26 2:21 AM, Andrew Morton wrote:
> On Fri, 31 Jul 2026 19:34:25 +0800 Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> wrote:
>
>> Lockdep reports a possible deadlock involving ip_alloc_sem,
>> j_trans_barrier, and ip_xattr_sem:
>>
>
> Cool.
>
> Sashiko said a couple of things:
> https://sashiko.dev/#/patchset/20260731113425.4130293-1-joseph.qi@xxxxxxxxxxxxxxxxx
>
Thanks, I'll take a deep look for the sashiko review comments.
>> Fix by swapping the lock order in both functions to acquire
>> ip_alloc_sem before ip_xattr_sem, consistent with the rest of the
>> codebase.
>>
>> Fixes: 09bf27a00020 ("ocfs2: Implement ocfs2_reflink.")
>> Fixes: 8b2c0dba5159 ("ocfs2: Call refcount tree remove process properly.")
>
> Should we backport this into -stable kernels?
>
Yes, I think it deserves.
Sorry for missing the cc stable tag.
Thanks,
Joseph