gfs2: fix freeze error handling

[ Upstream commit 4cfc7d5a4a01d2133b278cdbb1371fba1b419174 ]

After commit b77b4a4815 ("gfs2: Rework freeze / thaw logic"),
the freeze error handling is broken because gfs2_do_thaw()
overwrites the 'error' variable, causing incorrect processing
of the original freeze error.

Fix this by calling gfs2_do_thaw() when gfs2_lock_fs_check_clean()
fails but ignoring its return value to preserve the original
freeze error for proper reporting.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: b77b4a4815 ("gfs2: Rework freeze / thaw logic")
Cc: stable@vger.kernel.org # v6.5+
Signed-off-by: Alexey Velichayshiy <a.velichayshiy@ispras.ru>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
[ gfs2_do_thaw() only takes one param ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Alexey Velichayshiy
2025-12-29 18:15:51 -05:00
committed by Greg Kroah-Hartman
parent 35521feb61
commit 0baa9f64bf

View File

@@ -776,9 +776,7 @@ static int gfs2_freeze_super(struct super_block *sb, enum freeze_holder who)
if (!error)
break; /* success */
error = gfs2_do_thaw(sdp);
if (error)
goto out;
(void)gfs2_do_thaw(sdp);
if (error == -EBUSY)
fs_err(sdp, "waiting for recovery before freeze\n");