gfs2: Clear flags when withdraw prevents xmote
authorBob Peterson <rpeterso@redhat.com>
Thu, 18 Aug 2022 18:32:38 +0000 (13:32 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 25 Aug 2022 15:11:39 +0000 (17:11 +0200)
commit86934198eefa10a71f35162b06c44c36d85b98ba
tree83721033c4e294704fcc645aaf62b703bd1f952d
parent053640a73838400dca23087d66a9c0db579adafb
gfs2: Clear flags when withdraw prevents xmote

There are a couple places in function do_xmote where normal processing
is circumvented due to withdraws in progress. However, since we bypass
most of do_xmote() we bypass telling dlm to lock the dlm lock, which
means dlm will never respond with a completion callback. Since the
completion callback ordinarily clears GLF_LOCK, this patch changes
function do_xmote to handle those situations more gracefully so the
file system may be unmounted after withdraw.

A very similar situation happens with the GLF_DEMOTE_IN_PROGRESS flag,
which is cleared by function finish_xmote(). Since the withdraw causes
us to skip the majority of do_xmote, it therefore also skips the call
to finish_xmote() so the DEMOTE_IN_PROGRESS flag needs to be cleared
manually.

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