[lvc-project] [PATCH v2] gfs2: fix unreachable error handling after freeze/thaw rework
Alexey Velichayshiy
a.velichayshiy at ispras.ru
Tue Nov 11 23:40:50 MSK 2025
After commit b77b4a4815a9 ("gfs2: Rework freeze / thaw logic"), the second
error handling block in the freeze process became unreachable due to
misplaced gfs2_do_thaw() call. The thaw operation was incorrectly placed
within the error handling block of gfs2_lock_fs_check_clean(), causing
EBUSY/EIO error conditions to be processed as if they originated from
thaw rather than from the initial freeze check.
Move gfs2_do_thaw() call outside of gfs2_lock_fs_check_clean() error
handling block to restore proper error code processing and ensure
error messages accurately reflect their source.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexey Velichayshiy <a.velichayshiy at ispras.ru>
---
fs/gfs2/super.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
index 03b407a925dc..320bea5215f5 100644
--- a/fs/gfs2/super.c
+++ b/fs/gfs2/super.c
@@ -747,11 +747,7 @@ static int gfs2_freeze_super(struct super_block *sb, enum freeze_holder who,
set_bit(SDF_FREEZE_INITIATOR, &sdp->sd_flags);
set_bit(SDF_FROZEN, &sdp->sd_flags);
break;
- }
-
- error = gfs2_do_thaw(sdp, who, freeze_owner);
-
- if (error == -EBUSY)
+ } else if (error == -EBUSY)
fs_err(sdp, "waiting for recovery before freeze\n");
else if (error == -EIO) {
fs_err(sdp, "Fatal IO error: cannot freeze gfs2 due "
@@ -760,6 +756,11 @@ static int gfs2_freeze_super(struct super_block *sb, enum freeze_holder who,
} else {
fs_err(sdp, "error freezing FS: %d\n", error);
}
+
+ error = gfs2_do_thaw(sdp, who, freeze_owner);
+ if (error)
+ goto out;
+
fs_err(sdp, "retrying...\n");
msleep(1000);
}
--
2.43.0
More information about the lvc-project
mailing list