* [PATCH] iomap: don't report direct-io retries to fserror
@ 2026-02-24 15:46 Darrick J. Wong
2026-02-24 17:12 ` Christoph Hellwig
2026-02-26 8:23 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2026-02-24 15:46 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-fsdevel, xfs, Christian Brauner
From: Darrick J. Wong <djwong@kernel.org>
iomap's directio implementation has two magic errno codes that it uses
to signal callers -- ENOTBLK tells the filesystem that it should retry
a write with the pagecache; and EAGAIN tells the caller that pagecache
flushing or invalidation failed and that it should try again.
Neither of these indicate data loss, so let's not report them.
Fixes: a9d573ee88af98 ("iomap: report file I/O errors to the VFS")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
fs/iomap/direct-io.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index 95254aa1b6546a..e911daedff65ae 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -87,6 +87,19 @@ static inline enum fserror_type iomap_dio_err_type(const struct iomap_dio *dio)
return FSERR_DIRECTIO_READ;
}
+static inline bool should_report_dio_fserror(const struct iomap_dio *dio)
+{
+ switch (dio->error) {
+ case 0:
+ case -EAGAIN:
+ case -ENOTBLK:
+ /* don't send fsnotify for success or magic retry codes */
+ return false;
+ default:
+ return true;
+ }
+}
+
ssize_t iomap_dio_complete(struct iomap_dio *dio)
{
const struct iomap_dio_ops *dops = dio->dops;
@@ -96,7 +109,7 @@ ssize_t iomap_dio_complete(struct iomap_dio *dio)
if (dops && dops->end_io)
ret = dops->end_io(iocb, dio->size, ret, dio->flags);
- if (dio->error)
+ if (should_report_dio_fserror(dio))
fserror_report_io(file_inode(iocb->ki_filp),
iomap_dio_err_type(dio), offset, dio->size,
dio->error, GFP_NOFS);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] iomap: don't report direct-io retries to fserror
2026-02-24 15:46 [PATCH] iomap: don't report direct-io retries to fserror Darrick J. Wong
@ 2026-02-24 17:12 ` Christoph Hellwig
2026-02-26 8:23 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2026-02-24 17:12 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Christoph Hellwig, linux-fsdevel, xfs, Christian Brauner
On Tue, Feb 24, 2026 at 07:46:37AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> iomap's directio implementation has two magic errno codes that it uses
> to signal callers -- ENOTBLK tells the filesystem that it should retry
> a write with the pagecache; and EAGAIN tells the caller that pagecache
> flushing or invalidation failed and that it should try again.
>
> Neither of these indicate data loss, so let's not report them.
>
> Fixes: a9d573ee88af98 ("iomap: report file I/O errors to the VFS")
> Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] iomap: don't report direct-io retries to fserror
2026-02-24 15:46 [PATCH] iomap: don't report direct-io retries to fserror Darrick J. Wong
2026-02-24 17:12 ` Christoph Hellwig
@ 2026-02-26 8:23 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2026-02-26 8:23 UTC (permalink / raw)
To: Christoph Hellwig, Darrick J. Wong; +Cc: Christian Brauner, linux-fsdevel, xfs
On Tue, 24 Feb 2026 07:46:37 -0800, Darrick J. Wong wrote:
> iomap's directio implementation has two magic errno codes that it uses
> to signal callers -- ENOTBLK tells the filesystem that it should retry
> a write with the pagecache; and EAGAIN tells the caller that pagecache
> flushing or invalidation failed and that it should try again.
>
> Neither of these indicate data loss, so let's not report them.
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] iomap: don't report direct-io retries to fserror
https://git.kernel.org/vfs/vfs/c/cd3c877d0468
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-26 8:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-24 15:46 [PATCH] iomap: don't report direct-io retries to fserror Darrick J. Wong
2026-02-24 17:12 ` Christoph Hellwig
2026-02-26 8:23 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox