]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix up gfs2_glock_async_wait
authorAndreas Gruenbacher <agruenba@redhat.com>
Thu, 9 Jun 2022 11:39:10 +0000 (13:39 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 29 Jun 2022 14:47:44 +0000 (16:47 +0200)
commit597d424c7b42fc57ad1073d93b0031623dcd25a1
tree4b985f4231e48d36ee3b0dde73b079fb4cd718d2
parent95bff9fd66ecd812d590c69387965cb20664fd49
gfs2: Fix up gfs2_glock_async_wait

Since commit 8ea937e3f942 ("gfs2: cancel timed-out glock requests"), a
pending locking request can be canceled by calling gfs2_glock_dq() on
the pending holder.  In gfs2_glock_async_wait(), when we time out, use
that to cancel the remaining locking requests and dequeue the locking
requests already granted.  That's simpler as well as more efficient than
waiting for all locking requests to eventually be granted and dequeuing
them then.

In addition, gfs2_glock_async_wait() promises that by the time the
function completes, all glocks are either granted or dequeued, but the
implementation doesn't keep that promise if individual locking requests
fail.  Fix that as well.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c