]> 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)
commita801aef93d5a3e632e5ebf44596a51b6c0c31c90
tree4b985f4231e48d36ee3b0dde73b079fb4cd718d2
parent4f64cb9d4742408196e508a683a5f394c26fe503
gfs2: Fix up gfs2_glock_async_wait

Since commit d5ab065d4f5d ("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