diff options
| author | Hungyu Lin <dennylin0707@gmail.com> | 2026-11-02 06:15:55 +0000 |
|---|---|---|
| committer | Jan Kara <jack@suse.cz> | 2026-11-02 11:45:08 +0100 |
| commit | cbf04dde8b3c5a7e043e91cefad68b8980ea0d18 (patch) | |
| tree | f37c9b34eaf191335d6d2175f38befc0b49872dc /tools/perf/scripts/python/syscall-counts.py | |
| parent | 5406ffab820ebad6637cca8737192449dcd680d5 (diff) | |
ext2: preserve completed DIO bytes when buffered fallback fails
ext2_dio_write_iter() can complete part of a direct write before
falling back to buffered I/O for a hole inside i_size. If
generic_perform_write() then fails, its error overwrites the completed
direct-I/O byte count.
For example, on a full filesystem, an 8 KiB write to a file with an
allocated 4 KiB prefix and a 4 KiB hole overwrites the prefix but returns
ENOSPC and leaves the file position unchanged. GNU dd with oflag=direct
consequently reports zero bytes written.
Preserve a positive direct-I/O result and return the buffered error
when no bytes were direct-written. This restores the fallback policy of
generic_file_write_iter(), which ext2 used before its iomap conversion.
Fixes: fb5de4358e1a ("ext2: Move direct-io to use iomap")
Cc: stable@vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
Link: https://patch.msgid.link/20261102061555.55183-1-dennylin0707@gmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'tools/perf/scripts/python/syscall-counts.py')
0 files changed, 0 insertions, 0 deletions
