[lvc-project] [PATCH] gfs2: fix unreachable error handling after freeze/thaw rework
Andreas Gruenbacher
agruenba at redhat.com
Thu Nov 13 12:35:34 MSK 2025
Hello,
On Wed, Nov 12, 2025 at 9:58 PM Alexey Velichayshiy
<a.velichayshiy at ispras.ru> wrote:
> 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 | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c
> index 644b2d1e7276..d3e2bcf04c23 100644
> --- a/fs/gfs2/super.c
> +++ b/fs/gfs2/super.c
> @@ -747,21 +747,20 @@ 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)
> - goto out;
> -
> - if (error == -EBUSY)
> + } else if (error == -EBUSY) {
> fs_err(sdp, "waiting for recovery before freeze\n");
> - else if (error == -EIO) {
> + } else if (error == -EIO) {
> fs_err(sdp, "Fatal IO error: cannot freeze gfs2 due "
> "to recovery error.\n");
> goto out;
note that we break out of the loop here, so that would skip
gfs2_do_thaw(). I think we simply want to call gfs2_do_thaw() above
and ignore its return value instead of this patch. Any thoughts?
> } 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
>
Thanks,
Andreas
More information about the lvc-project
mailing list