Linux XFS filesystem development
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Long Li <leo.lilong@huawei.com>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org, david@fromorbit.com,
	yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com,
	lonuxli.64@gmail.com
Subject: Re: [PATCH 2/2] xfs: don't swallow dquot recovery verification errors
Date: Sun, 26 Jul 2026 20:40:55 -0700	[thread overview]
Message-ID: <20260727034055.GC2901224@frogsfrogsfrogs> (raw)
In-Reply-To: <20260727023849.3247961-2-leo.lilong@huawei.com>

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: <stable@vger.kernel.org> # v6.8
> Signed-off-by: Long Li <leo.lilong@huawei.com>

Yep, that also looks like a bug
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--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
> 
> 

  reply	other threads:[~2026-07-27  3:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27  2:38 [PATCH 1/2] xfs: fix ilock leak on error in xfs_dq_get_next_id Long Li
2026-07-27  2:38 ` [PATCH 2/2] xfs: don't swallow dquot recovery verification errors Long Li
2026-07-27  3:40   ` Darrick J. Wong [this message]
2026-07-28  3:17   ` Christoph Hellwig
2026-07-27  3:40 ` [PATCH 1/2] xfs: fix ilock leak on error in xfs_dq_get_next_id Darrick J. Wong
2026-07-28  3:17 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260727034055.GC2901224@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=david@fromorbit.com \
    --cc=houtao1@huawei.com \
    --cc=leo.lilong@huawei.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=lonuxli.64@gmail.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox