gfs2: Allow some glocks to be used during withdraw
authorBob Peterson <rpeterso@redhat.com>
Thu, 13 Jun 2019 18:28:45 +0000 (13:28 -0500)
committerBob Peterson <rpeterso@redhat.com>
Thu, 20 Feb 2020 17:01:36 +0000 (11:01 -0600)
commita72d2401f54b7db41c77ab971238a06eafe929fb
treef1055bffda071498f6da9577c4b12aabc57fa299
parent0d91061a372671aec1af729686ad9241a59fc328
gfs2: Allow some glocks to be used during withdraw

We need to allow some glocks to be enqueued, dequeued, promoted, and demoted
when we're withdrawn. For example, to maintain metadata integrity, we should
disallow the use of inode and rgrp glocks when withdrawn. Other glocks, like
iopen or the transaction glocks may be safely used because none of their
metadata goes through the journal. So in general, we should disallow all
glocks with an address space, and allow all the others. One exception is:
we need to allow our active journal to be demoted so others may recover it.

Allowing glocks after withdraw gives us the ability to take appropriate
action (in a following patch) to have our journal properly replayed by
another node rather than just abandoning the current transactions and
pretending nothing bad happened, leaving the other nodes free to modify
the blocks we had in our journal, which may result in file system
corruption.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/glock.c
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/ops_fstype.c