Skip to content

Commit 591ce66

Browse files
Andreas Gruenbachergregkh
authored andcommitted
gfs2: Don't call cancel_delayed_work_sync from within delete work function
commit 6bd1c7b 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: a0e3cc6 ("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>
1 parent ee4891e commit 591ce66

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/gfs2/inode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
180180
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
181181
if (unlikely(error))
182182
goto fail;
183-
gfs2_cancel_delete_work(ip->i_iopen_gh.gh_gl);
183+
if (blktype != GFS2_BLKST_UNLINKED)
184+
gfs2_cancel_delete_work(ip->i_iopen_gh.gh_gl);
184185
glock_set_object(ip->i_iopen_gh.gh_gl, ip);
185186
gfs2_glock_put(io_gl);
186187
io_gl = NULL;

0 commit comments

Comments
 (0)