From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org, Carlos Maiolino <cmaiolino@redhat.com>
Subject: Re: [PATCH 2/6] xfs: also mark the buffer stale on verifier failure in xfs_buf_submit
Date: Thu, 25 Jun 2026 11:00:02 -0700 [thread overview]
Message-ID: <20260625180002.GG6078@frogsfrogsfrogs> (raw)
In-Reply-To: <20260625135849.2494779-3-hch@lst.de>
On Thu, Jun 25, 2026 at 03:58:32PM +0200, Christoph Hellwig wrote:
> We should treat the buffer that caused a shutdown the same as handling
> buffers after a shutdown, so use the same stale && !DONE logic here.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/xfs/xfs_buf.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index a108d31996f2..5ce48d8062fa 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1383,8 +1383,10 @@ xfs_buf_submit(
> * state here rather than mount state to avoid corrupting the log tail
> * on shutdown.
> */
> - if (bp->b_mount->m_log && xlog_is_shutdown(bp->b_mount->m_log))
> + if (bp->b_mount->m_log && xlog_is_shutdown(bp->b_mount->m_log)) {
> + xfs_buf_ioerror(bp, -EIO);
> goto ioerror;
IDGI. If the filesystem was already shut down, we set EIO on the
buffer, stale it, and complete the ioend...
> + }
>
> if (bp->b_flags & XBF_WRITE)
> xfs_buf_wait_unpin(bp);
> @@ -1397,7 +1399,7 @@ xfs_buf_submit(
>
> if ((bp->b_flags & XBF_WRITE) && !xfs_buf_verify_write(bp)) {
> xfs_force_shutdown(bp->b_mount, SHUTDOWN_CORRUPT_INCORE);
> - goto end_io;
> + goto ioerror;
...but if bp itself causes the shutdown, we now leave b_error at 0, but
do the same stale-and-complete thing? Shouldn't we set EIO on the
buffer in both cases?
--D
> }
>
> /* In-memory targets are directly mapped, no I/O required. */
> @@ -1410,7 +1412,6 @@ xfs_buf_submit(
> ioerror:
> bp->b_flags &= ~XBF_DONE;
> xfs_buf_stale(bp);
> - xfs_buf_ioerror(bp, -EIO);
> end_io:
> xfs_buf_ioend(bp);
> }
> --
> 2.53.0
>
>
next prev parent reply other threads:[~2026-06-25 18:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 13:58 xfs_buf_submit error handling fix v2 Christoph Hellwig
2026-06-25 13:58 ` [PATCH 1/6] xfs: open code xfs_buf_ioend_fail in xfs_buf_submit Christoph Hellwig
2026-06-25 13:58 ` [PATCH 2/6] xfs: also mark the buffer stale on verifier failure " Christoph Hellwig
2026-06-25 18:00 ` Darrick J. Wong [this message]
2026-06-26 4:35 ` Christoph Hellwig
2026-06-26 6:21 ` Darrick J. Wong
2026-06-26 6:23 ` Christoph Hellwig
2026-06-26 14:47 ` Darrick J. Wong
2026-06-25 13:58 ` [PATCH 3/6] xfs: improve the xfs_buf_ioend_fail calling convention Christoph Hellwig
2026-06-25 18:04 ` Darrick J. Wong
2026-06-25 13:58 ` [PATCH 4/6] xfs: remove xfs_buf_ioend Christoph Hellwig
2026-06-25 18:09 ` Darrick J. Wong
2026-06-25 13:58 ` [PATCH 5/6] xfs: fix handling of synchronous errors in xfs_buf_submit Christoph Hellwig
2026-06-25 18:13 ` Darrick J. Wong
2026-06-26 4:36 ` Christoph Hellwig
2026-06-25 13:58 ` [PATCH 6/6] xfs: simplify __xfs_buf_ioend Christoph Hellwig
2026-06-25 18:30 ` Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2026-06-22 7:29 xfs_buf_submit error handling fix Christoph Hellwig
2026-06-22 7:30 ` [PATCH 2/6] xfs: also mark the buffer stale on verifier failure in xfs_buf_submit Christoph Hellwig
2026-06-22 12:42 ` Carlos Maiolino
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=20260625180002.GG6078@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=cmaiolino@redhat.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/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.