[lvc-project] [PATCH v2] gfs2: eliminate unreachable code in gfs2_freeze_super()
Alexey Velichayshiy
a.velichayshiy at ispras.ru
Mon Nov 10 23:48:07 MSK 2025
Move gfs2_do_thaw() call outside of gfs2_lock_fs_check_clean() error
handling block to ensure proper error code processing.
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