From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: Jia-Ju Bai <baijiaju1990@gmail.com>, mark@fasheh.com, jlbec@evilplan.org
Cc: ocfs2-devel@oss.oracle.com, linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] fs: ocfs2: possible ABBA deadlock in ocfs2_dio_end_io_write() and ocfs2_move_extents()
Date: Tue, 14 Dec 2021 15:08:39 +0800 [thread overview]
Message-ID: <bd6dfb63-6d3d-c8f6-f401-8bdd5334afed@linux.alibaba.com> (raw)
In-Reply-To: <8ae1bb9c-3e58-c8b6-8823-3d2ea8b241e2@gmail.com>
Hi,
Thanks for the report. But I don't think this is a possible deadlock in
practice. Please see my comments below.
On 12/10/21 4:38 PM, Jia-Ju Bai wrote:
> Hello,
>
> My static analysis tool reports a possible ABBA deadlock in the ocfs2 module in Linux 5.10:
>
> ocfs2_dio_end_io_write()
> down_write(&oi->ip_alloc_sem); --> Line 2322 (Lock A)
> ocfs2_del_inode_from_orphan()
> inode_lock(orphan_dir_inode); --> Line 2701 (Lock B)
Just as the variable name indicates, it is orphan dir inode, which is a
system file (something hidden inside the filesystem) and not visible for
end user.
>
> ocfs2_move_extents()
> inode_lock(inode); --> Line 916 (Lock B)
This is called from a ioctl from user, it a normal file inode.
Thanks,
Joseph
> down_write(&OCFS2_I(inode)->ip_alloc_sem); --> Line 936 (Lock A)
>
> When ocfs2_dio_end_io_write() and ocfs2_move_extents() are concurrently executed, the deadlocks can occur.
>
> I am not quite sure whether this possible deadlock is real and how to fix it if it is real.
> Any feedback would be appreciated, thanks :)
>
> Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
>
>
> Best wishes,
> Jia-Ju Bai
next prev parent reply other threads:[~2021-12-14 7:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 8:38 Jia-Ju Bai
2021-12-14 7:08 ` Joseph Qi [this message]
2021-12-14 7:19 ` Jia-Ju Bai
-- strict thread matches above, loose matches on Subject: below --
2021-12-10 8:37 Jia-Ju Bai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bd6dfb63-6d3d-c8f6-f401-8bdd5334afed@linux.alibaba.com \
--to=joseph.qi@linux.alibaba.com \
--cc=baijiaju1990@gmail.com \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®