Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iomap: don't report direct-io retries to fserror

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>
Link: https://patch.msgid.link/20260224154637.GD2390381@frogsfrogsfrogs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Darrick J. Wong and committed by
Christian Brauner
cd3c877d d9d32e5b

+14 -1
+14 -1
fs/iomap/direct-io.c
··· 87 87 return FSERR_DIRECTIO_READ; 88 88 } 89 89 90 + static inline bool should_report_dio_fserror(const struct iomap_dio *dio) 91 + { 92 + switch (dio->error) { 93 + case 0: 94 + case -EAGAIN: 95 + case -ENOTBLK: 96 + /* don't send fsnotify for success or magic retry codes */ 97 + return false; 98 + default: 99 + return true; 100 + } 101 + } 102 + 90 103 ssize_t iomap_dio_complete(struct iomap_dio *dio) 91 104 { 92 105 const struct iomap_dio_ops *dops = dio->dops; ··· 109 96 110 97 if (dops && dops->end_io) 111 98 ret = dops->end_io(iocb, dio->size, ret, dio->flags); 112 - if (dio->error) 99 + if (should_report_dio_fserror(dio)) 113 100 fserror_report_io(file_inode(iocb->ki_filp), 114 101 iomap_dio_err_type(dio), offset, dio->size, 115 102 dio->error, GFP_NOFS);