]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix deadlock dumping resource group glocks
authorAlexander Aring <aahringo@redhat.com>
Sun, 22 Nov 2020 23:10:24 +0000 (18:10 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 24 Nov 2020 22:45:58 +0000 (23:45 +0100)
commit1b1fd364e3b9df990d4fbda94a829c5cb45775cc
tree48ca6ba8ee370a7c40b7a5e99d84c394341d39a0
parent40553dea78f7e9ff35aa9c37540f0b960193749a
gfs2: Fix deadlock dumping resource group glocks

Commit f8352ca43891 ("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: f8352ca43891 ("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>
fs/gfs2/glops.c