* [Cluster-devel] [GFS2 PATCH] gfs2: Don't loop forever in gfs2_freeze if withdrawn
@ 2019-11-14 14:53 Bob Peterson
0 siblings, 0 replies; only message in thread
From: Bob Peterson @ 2019-11-14 14:53 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
Before this patch, function gfs2_freeze would loop forever if the
file system trying to be frozen is withdrawn. That's because function
gfs2_lock_fs_check_clean tries to enqueue the glock of the journal
and the gfs2_glock returns -EIO because you can't enqueue a journaled
glock after a withdraw.
This patch moves the check for file system withdraw inside the loop
so that the loop can end when withdraw occurs.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
---
fs/gfs2/super.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 478015bc6890..8154c38e488b 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -761,12 +761,12 @@ static int gfs2_freeze(struct super_block *sb)
if (atomic_read(&sdp->sd_freeze_state) != SFS_UNFROZEN)
goto out;
- if (gfs2_withdrawn(sdp)) {
- error = -EINVAL;
- goto out;
- }
-
for (;;) {
+ if (gfs2_withdrawn(sdp)) {
+ error = -EINVAL;
+ goto out;
+ }
+
error = gfs2_lock_fs_check_clean(sdp, &sdp->sd_freeze_gh);
if (!error)
break;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-14 14:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-14 14:53 [Cluster-devel] [GFS2 PATCH] gfs2: Don't loop forever in gfs2_freeze if withdrawn Bob Peterson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).