]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix deadlock between gfs2_{create_inode,inode_lookup} and delete_work_func
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 30 Nov 2020 15:07:25 +0000 (16:07 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 30 Nov 2020 23:21:10 +0000 (00:21 +0100)
commit753e1852fb607a8b6739c22fa160171b41e10712
treeccf085761b50314f2c65aa68e1af0db5c4ac07d6
parent78839090fd7040c44888b82311b62b696475fd97
gfs2: Fix deadlock between gfs2_{create_inode,inode_lookup} and delete_work_func

In gfs2_create_inode and gfs2_inode_lookup, make sure to cancel any pending
delete work before taking the inode glock.  Otherwise, gfs2_cancel_delete_work
may block waiting for delete_work_func to complete, and delete_work_func may
block trying to acquire the inode glock in gfs2_inode_lookup.

Reported-by: Alexander Aring <aahringo@redhat.com>
Fixes: c754225effa0 ("gfs2: Turn gl_delete into a delayed work")
Cc: stable@vger.kernel.org # v5.8+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/inode.c