]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:27:54 +0000 (08:27 +0200)
commitbb777c5d898c322f7673e8366ca00fd719ed268a
treec9e37de22e8cc9d77ab5cfabdb3f0ccb39de5f6f
parent2e8741fbbcb71617aadd892d7c852cb8e173b3a9
gfs2: fix scheduling while atomic bug in glocks

BugLink: https://bugs.launchpad.net/bugs/1933691
commit 20265d9a67e40eafd39a8884658ca2e36f05985d upstream.

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: 601ef0d52e96 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/gfs2/glock.c