From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Eric Sandeen <sandeen@redhat.com>,
"linux-xfs@vger.kernel.org" <linux-xfs@vger.kernel.org>,
Donald Douwsma <ddouwsma@redhat.com>
Subject: Re: [PATCH RFC] xfs: remap block layer ENODATA read errors to EIO
Date: Tue, 19 Aug 2025 07:34:43 -0700 [thread overview]
Message-ID: <20250819143443.GA7965@frogsfrogsfrogs> (raw)
In-Reply-To: <aKQxD_txX68w4Tb-@infradead.org>
On Tue, Aug 19, 2025 at 01:08:47AM -0700, Christoph Hellwig wrote:
> On Mon, Aug 18, 2025 at 03:22:02PM -0500, Eric Sandeen wrote:
> > diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> > index f9ef3b2a332a..6ba57ccaa25f 100644
> > --- a/fs/xfs/xfs_buf.c
> > +++ b/fs/xfs/xfs_buf.c
> > @@ -747,6 +747,9 @@ xfs_buf_read_map(
> > /* bad CRC means corrupted metadata */
> > if (error == -EFSBADCRC)
> > error = -EFSCORRUPTED;
> > + /* ENODATA == ENOATTR which confuses xattr layers */
> > + if (error == -ENODATA)
> > + error = -EIO;
>
> I think we need to stop passing random errors through here (same
> for the write side). Unless we have an explicit handler (which we
> have for a tiny number of errors), passing random stuff we got through
> and which higher layers use for their own purpose will cause trouble.
>
> Btw, your patch is timely as I've just seen something that probably
> is the same root cause when running XFS on a device with messed up
> PI, which is another of those cases where the block layer returns
> "odd" error codes.
Maybe xfs should translate bi_status into whatever error codes it wants
directly instead of relying on blk_status_to_errno, which can change in
subtle ways?
Though how many of those status codes actually need a different error?
BLK_STS_MEDIUM (ENODATA) and BLK_STS_NOTSUPP (EOPNOTSUPP) are the only
ones that look (to me) like they could be confused easily.
--D
next prev parent reply other threads:[~2025-08-19 14:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-18 20:22 [PATCH RFC] xfs: remap block layer ENODATA read errors to EIO Eric Sandeen
2025-08-18 20:45 ` Darrick J. Wong
2025-08-18 21:11 ` Eric Sandeen
2025-08-18 23:04 ` Darrick J. Wong
2025-08-21 9:16 ` Donald Douwsma
2025-08-21 9:29 ` [PATCH] xfs: test case for handling io errors when reading extended attributes Donald Douwsma
2025-08-21 12:52 ` [PATCH RFC] xfs: remap block layer ENODATA read errors to EIO Carlos Maiolino
2025-08-21 20:06 ` Eric Sandeen
2025-08-22 7:38 ` Donald Douwsma
2025-08-18 22:09 ` Dave Chinner
2025-08-19 2:27 ` Eric Sandeen
2025-08-19 8:08 ` Christoph Hellwig
2025-08-19 14:34 ` Darrick J. Wong [this message]
2025-08-19 14:48 ` Christoph Hellwig
2025-08-19 15:14 ` Eric Sandeen
2025-08-19 15:23 ` Christoph Hellwig
2025-08-19 15:38 ` Eric Sandeen
2025-08-19 15:41 ` Christoph Hellwig
2025-08-19 21:45 ` Dave Chinner
2025-08-20 0:16 ` Eric Sandeen
2025-08-25 7:51 ` 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=20250819143443.GA7965@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=ddouwsma@redhat.com \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@redhat.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;
as well as URLs for NNTP newsgroup(s).