]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
commitdd0ecf544125639e54056d851e4887dbb94b6d2f
treeccf085761b50314f2c65aa68e1af0db5c4ac07d6
parent82e938bd5382b322ce81e6cb8fd030987f2da022
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: a0e3cc65fa29 ("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