From: Christoph Hellwig <hch@infradead.org>
To: Long Li <leo.lilong@huawei.com>
Cc: djwong@kernel.org, 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: remove bp->b_error check in xfs_attr3_root_inactive
Date: Sat, 21 Dec 2024 00:08:56 -0800 [thread overview]
Message-ID: <Z2Z3mLjW7KXQKexP@infradead.org> (raw)
In-Reply-To: <20241221063043.106037-3-leo.lilong@huawei.com>
On Sat, Dec 21, 2024 at 02:30:43PM +0800, Long Li wrote:
> The xfs_da3_node_read earlier in the function will catch most cases of
> incoming on-disk corruption, which makes this check mostly redundant,
> unless someone corrupts the buffer and the AIL pushes it out to disk
> while the buffer's unlocked.
>
> In the first case we'll never reach this check, and in the second case
> the AIL will shut down the log, at which point checking b_error becomes
> meaningless. Remove the check to make the code consistent with most other
> xfs_trans_get_buf() callers in XFS.
Hmm. I don't really understand the commit log. The b_error check
is right after a call to xfs_trans_get_buf_map. xfs_trans_get_buf_map
either reads the buffer from disk using xfs_buf_get_map which propagates
b_error, or finds it in the transaction, where whoever read it from
disk should have done the same. So I think the change looks fine,
but I don't think the commit log really explains it very well.
next prev parent reply other threads:[~2024-12-21 8:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-21 6:30 [PATCH 0/2] xfs: two small cleanup Long Li
2024-12-21 6:30 ` [PATCH 1/2] xfs: remove redundant update for t_curr_res in xfs_log_ticket_regrant Long Li
2024-12-21 8:05 ` Christoph Hellwig
2024-12-23 1:04 ` Long Li
2024-12-21 6:30 ` [PATCH 2/2] xfs: remove bp->b_error check in xfs_attr3_root_inactive Long Li
2024-12-21 8:08 ` Christoph Hellwig [this message]
2024-12-23 1:08 ` Long Li
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=Z2Z3mLjW7KXQKexP@infradead.org \
--to=hch@infradead.org \
--cc=cem@kernel.org \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.