On 2023/3/26 22:31, Theodore Ts'o wrote:
On Sat, Mar 25, 2023 at 02:56:50PM +0800, zhanchengbin wrote:
If there is an EIO during the process of fsck, the user can be notified of it.
Can you identify a code path where the user is *not* getting notified
while e2fsck is running without this patch series?
The unix_io.c module calls fsync() through unix_flush() only. When
unix_write_byte() calls flush_cached blocks(), if the read or write
system call fails, the error will be returned to the caller of
flush_cached_byte(), and the unix_write_byte() will return the error
back to the caller (in this case, e2fsck).
io_channel_flush and io_channel_write_byte do have return values, but
they may not necessarily be checked at their calling points. As in the
following path:
e2fsck_run_ext3_journal
ext2fs_flush // Ignore errors.
ext2fs_flush2
io_channel_flush
ext2fs_mmp_stop // Ignore errors.
ext2fs_mmp_write
io_channel_flush
ext2fs_flush // Many calls ignore errors.
ext2fs_flush2
write_primary_superblock
io_channel_write_byte
Thanks,
- bin.
So in both cases, e2fsck checks the error return from ext2fs_flush()
(which is the only place where write_byte gets called) and
io_channel->flush(), and so the user will get some kind of error
report already.
The error message might not identify exactly what I/O failed, but the
"Error sync" message that this commit series provides is not going to
be much better.
- Ted
.