]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: Don't call cancel_delayed_work_sync from within delete work function
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 2 Nov 2020 20:11:30 +0000 (21:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 11:39:01 +0000 (12:39 +0100)
commit591ce666fd163c6e6fb6d3ce073334278f9fd116
tree06c6b09b11dfa2fb8d68f758d9bd187d71626411
parentee4891e425bedb81ae866d4cf3e9e4a0406a5aca
gfs2: Don't call cancel_delayed_work_sync from within delete work function

commit 6bd1c7bd4ee7b17980cdc347522dcb76feac9b98 upstream.

Right now, we can end up calling cancel_delayed_work_sync from within
delete_work_func via gfs2_lookup_by_inum -> gfs2_inode_lookup ->
gfs2_cancel_delete_work.  When that happens, it will result in a
deadlock.  Instead, gfs2_inode_lookup should skip the call to
gfs2_cancel_delete_work when called from delete_work_func (blktype ==
GFS2_BLKST_UNLINKED).

Reported-by: Alexander Ahring Oder 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/inode.c