Re: [PATCH 2/2] xfs: don't swallow dquot recovery verification errors

"Darrick J. Wong" <[email protected]> Sun, 26 Jul 2026 20:40:55 -0700
Newsgroups org.kernel.vger.linux-xfs
Message-ID <20260727034055.GC2901224@frogsfrogsfrogs>
On Mon, Jul 27, 2026 at 10:38:49AM +0800, Long Li wrote:
> 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: <[email protected]> # v6.8
> Signed-off-by: Long Li <[email protected]>

Yep, that also looks like a bug
Reviewed-by: "Darrick J. Wong" <[email protected]>

--D

> ---
>  fs/xfs/xfs_dquot_item_recover.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_dquot_item_recover.c b/fs/xfs/xfs_dquot_item_recover.c
> index fe419b28de22..63bc9ab7d947 100644
> --- a/fs/xfs/xfs_dquot_item_recover.c
> +++ b/fs/xfs/xfs_dquot_item_recover.c
> @@ -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 = {
> -- 
> 2.52.0
> 
>