gfs2: When freezing gfs2, use GL_EXACT and not GL_NOCACHE
authorBob Peterson <rpeterso@redhat.com>
Thu, 25 Jun 2020 18:30:52 +0000 (13:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:01 +0000 (09:34 +0200)
commitc26a517fe322910a7fea885af6328436ccc18dac
tree6dbcfb1b197af72045180f1b029a9686625a5fc9
parentc1647153c8ac5a196149c42f94aa9f8dba04ca60
gfs2: When freezing gfs2, use GL_EXACT and not GL_NOCACHE

[ Upstream commit 623ba664b74a20f22a2ef7ebd71e171d2d7c626f ]

Before this patch, the freeze code in gfs2 specified GL_NOCACHE in
several places. That's wrong because we always want to know the state
of whether the file system is frozen.

There was also a problem with freeze/thaw transitioning the glock from
frozen (EX) to thawed (SH) because gfs2 will normally grant glocks in EX
to processes that request it in SH mode, unless GL_EXACT is specified.
Therefore, the freeze/thaw code, which tried to reacquire the glock in
SH mode would get the glock in EX mode, and miss the transition from EX
to SH. That made it think the thaw had completed normally, but since the
glock was still cached in EX, other nodes could not freeze again.

This patch removes the GL_NOCACHE flag to allow the freeze glock to be
cached. It also adds the GL_EXACT flag so the glock is fully transitioned
from EX to SH, thereby allowing future freeze operations.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/recovery.c
fs/gfs2/super.c