]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: Fix regression in freeze_go_sync
authorBob Peterson <rpeterso@redhat.com>
Wed, 18 Nov 2020 13:54:31 +0000 (08:54 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 18 Nov 2020 15:28:11 +0000 (16:28 +0100)
commit1b3b0696f8dbfc8b8a054b20f38592ed2d6f937e
tree585cd61c8decf037015a12773334c0b847471894
parent52303c159aaf2219cfa60dd0f7bf7c06a1d70995
gfs2: Fix regression in freeze_go_sync

Patch fe68888df243 ("gfs2: freeze should work on read-only mounts") changed
the check for glock state in function freeze_go_sync() from "gl->gl_state
== LM_ST_SHARED" to "gl->gl_req == LM_ST_EXCLUSIVE".  That's wrong and it
regressed gfs2's freeze/thaw mechanism because it caused only the freezing
node (which requests the glock in EX) to queue freeze work.

All nodes go through this go_sync code path during the freeze to drop their
SHared hold on the freeze glock, allowing the freezing node to acquire it
in EXclusive mode. But all the nodes must freeze access to the file system
locally, so they ALL must queue freeze work. The freeze_work calls
freeze_func, which makes a request to reacquire the freeze glock in SH,
effectively blocking until the thaw from the EX holder. Once thawed, the
freezing node drops its EX hold on the freeze glock, then the (blocked)
freeze_func reacquires the freeze glock in SH again (on all nodes, including
the freezer) so all nodes go back to a thawed state.

This patch changes the check back to gl_state == LM_ST_SHARED like it was
prior to fe68888df243.

Fixes: fe68888df243 ("gfs2: freeze should work on read-only mounts")
Cc: stable@vger.kernel.org # v5.8+
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glops.c