Re: [PATCH] ocfs2: fix lock acquisition order in refcounttree

From: Andrew Morton

Date: Sat Apr 25 2026 - 17:26:46 EST


On Mon, 14 Jul 2025 19:15:32 -0300 Diogo Jahchan Koike <djahchankoike@xxxxxxxxx> wrote:

> Acquiring the locks in refcounttree should follow
> the ip_alloc --> ip_xattr ordering, as done by multiple
> code paths in ocfs2; otherwise, we risk an ABBA deadlock
> (i.e in the start transaction path).
>
> Reported-by: syzbot+1fed2de07d8e11a3ec1b@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=1fed2de07d8e11a3ec1b

But ocfs2_reflink() does

down_write(&OCFS2_I(inode)->ip_xattr_sem);
down_write(&OCFS2_I(inode)->ip_alloc_sem);