OSDN Git Service

gfs2: Don't freeze the file system during unmount
authorBob Peterson <rpeterso@redhat.com>
Tue, 24 Nov 2020 16:41:40 +0000 (10:41 -0600)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 25 Nov 2020 17:12:08 +0000 (18:12 +0100)
commitf39e7d3aae2934b1cfdd209b54c508e2552e9531
treef8a74817026bdbbe3fb13d0279b94c7c6df6aeea
parent778721510e84209f78e31e2ccb296ae36d623f5e
gfs2: Don't freeze the file system during unmount

GFS2's freeze/thaw mechanism uses a special freeze glock to control its
operation. It does this with a sync glock operation (glops.c) called
freeze_go_sync. When the freeze glock is demoted (glock's do_xmote) the
glops function causes the file system to be frozen. This is intended. However,
GFS2's mount and unmount processes also hold the freeze glock to prevent other
processes, perhaps on different cluster nodes, from mounting the frozen file
system in read-write mode.

Before this patch, there was no check in freeze_go_sync for whether a freeze
in intended or whether the glock demote was caused by a normal unmount.
So it was trying to freeze the file system it's trying to unmount, which
ends up in a deadlock.

This patch adds an additional check to freeze_go_sync so that demotes of the
freeze glock are ignored if they come from the unmount process.

Fixes: 20b329129009 ("gfs2: Fix regression in freeze_go_sync")
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glops.c