]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: fix scheduling while atomic bug in glocks
authorBob Peterson <rpeterso@redhat.com>
Tue, 18 May 2021 13:12:10 +0000 (09:12 -0400)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 20 May 2021 11:31:37 +0000 (13:31 +0200)
commitea2a6262e23b32d2ac2bcfc8f31eb1ec03d4e47e
treef944efab603c456faf64c95ae23c783ba011dd3e
parentd435c52fcd804046f8bc83ec64e19f6a1c5356f5
gfs2: fix scheduling while atomic bug in glocks

Before this patch, in the unlikely event that gfs2_glock_dq encountered
a withdraw, it would do a wait_on_bit to wait for its journal to be
recovered, but it never released the glock's spin_lock, which caused a
scheduling-while-atomic error.

This patch unlocks the lockref spin_lock before waiting for recovery.

Fixes: ec381c1f2570 ("gfs2: Force withdraw to replay journals and wait for it to finish")
Cc: stable@vger.kernel.org # v5.7+
Reported-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c