[<prev] [next>] [day] [month] [year] [list]
Message-ID: <7713e8e4-d397-ab73-4277-c03cc7d1c227@gmail.com>
Date: Fri, 10 Dec 2021 16:37:31 +0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: mark@...heh.com, jlbec@...lplan.org, joseph.qi@...ux.alibaba.com
Cc: ocfs2-devel@....oracle.com,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: [BUG] fs: ocfs2: possible ABBA deadlock in ocfs2_dio_end_io_write()
and ocfs2_move_extents()
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)
ocfs2_move_extents()
inode_lock(inode); --> Line 916 (Lock B)
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@...nghua.edu.cn>
Best wishes,
Jia-Ju Bai
Powered by blists - more mailing lists