]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: don't swallow dquot recovery verification errors
authorLong Li <leo.lilong@huawei.com>
Mon, 27 Jul 2026 02:38:49 +0000 (10:38 +0800)
committerCarlos Maiolino <cem@kernel.org>
Mon, 3 Aug 2026 08:21:33 +0000 (10:21 +0200)
xlog_recover_dquot_commit_pass2() validates the recovered dquot with
xfs_dqblk_verify() and, on failure, sets error = -EFSCORRUPTED and jumps
to out_release.  But out_release unconditionally returns 0, so the
corruption error is discarded: the caller xlog_recover_items_pass2()
sees success, log recovery proceeds as if the dquot were valid, and the
corrupt quota buffer can be written back to disk.

Fixes: 9c235dfc3d3f ("xfs: dquot recovery does not validate the recovered dquot")
Cc: stable@vger.kernel.org # v6.8
Signed-off-by: Long Li <leo.lilong@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_dquot_item_recover.c

index fe419b28de22b319ab5aea61f646a3efa296a8de..63bc9ab7d947deb3871eb7ca5b684431ed4b8d9b 100644 (file)
@@ -173,7 +173,7 @@ xlog_recover_dquot_commit_pass2(
 
 out_release:
        xfs_buf_relse(bp);
-       return 0;
+       return error;
 }
 
 const struct xlog_recover_item_ops xlog_dquot_item_ops = {