gfs2: read-only mounts should grab the sd_freeze_gl glock
authorBob Peterson <rpeterso@redhat.com>
Thu, 25 Jun 2020 18:30:18 +0000 (13:30 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Jul 2020 07:34:01 +0000 (09:34 +0200)
commitc1647153c8ac5a196149c42f94aa9f8dba04ca60
tree493be71bb91688fef1bacbc15fc037586b5ed239
parentaa12cb52e1a7c5ec7a013e95cd1950411d665826
gfs2: read-only mounts should grab the sd_freeze_gl glock

[ Upstream commit b780cc615ba4795a7ef0e93b19424828a5ad456a ]

Before this patch, only read-write mounts would grab the freeze
glock in read-only mode, as part of gfs2_make_fs_rw. So the freeze
glock was never initialized. That meant requests to freeze, which
request the glock in EX, were granted without any state transition.
That meant you could mount a gfs2 file system, which is currently
frozen on a different cluster node, in read-only mode.

This patch makes read-only mounts lock the freeze glock in SH mode,
which will block for file systems that are frozen on another node.

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