Skip to content

Commit 16e6281

Browse files
Alexander AringAndreas Gruenbacher
authored andcommitted
gfs2: Fix deadlock dumping resource group glocks
Commit 0e539ca ("gfs2: Fix NULL pointer dereference in gfs2_rgrp_dump") introduced additional locking in gfs2_rgrp_go_dump, which is also used for dumping resource group glocks via debugfs. However, on that code path, the glock spin lock is already taken in dump_glock, and taking it again in gfs2_glock2rgrp leads to deadlock. This can be reproduced with: $ mkfs.gfs2 -O -p lock_nolock /dev/FOO $ mount /dev/FOO /mnt/foo $ touch /mnt/foo/bar $ cat /sys/kernel/debug/gfs2/FOO/glocks Fix that by not taking the glock spin lock inside the go_dump callback. Fixes: 0e539ca ("gfs2: Fix NULL pointer dereference in gfs2_rgrp_dump") Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 418baf2 commit 16e6281

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/gfs2/glops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ static void rgrp_go_inval(struct gfs2_glock *gl, int flags)
245245
static void gfs2_rgrp_go_dump(struct seq_file *seq, struct gfs2_glock *gl,
246246
const char *fs_id_buf)
247247
{
248-
struct gfs2_rgrpd *rgd = gfs2_glock2rgrp(gl);
248+
struct gfs2_rgrpd *rgd = gl->gl_object;
249249

250250
if (rgd)
251251
gfs2_rgrp_dump(seq, rgd, fs_id_buf);

0 commit comments

Comments
 (0)