Skip to content

ext4: properly sync file size update after O_SYNC direct IO

Carlos Maiolino requested to merge cmaiolino/centos-stream-9:el94_rhel21230 into main

JIRA: https://issues.redhat.com/browse/RHEL-23635 Tested: with xfstests

The fix for the file size update on ext4, relies on a slightly different semantics of iomap_dio_complete(), so we must have this change to iomap_dio_complete() BEFORE the ext4 patches, since these patches were already merged, we must first revert them.

iomap_dio_complete() file position update got moved later in the function. Before, it only updated it when the end_io callback returned 0, now, the callback returns the amount of bytes written, which are used to increment the file position. If this is not changed in iomap, ext4 ends up not updating the file position, having consecutive writes writing to the same offset.

We could come up with a rhel-specific solution, but diverging from upstream here doesn't make much sense to me.

Signed-off-by: Carlos Maiolino cmaiolino@redhat.com

Edited by Carlos Maiolino

Merge request reports