diff options
| author | Hongling Zeng <zenghongling@kylinos.cn> | 2026-07-30 16:42:36 +0800 |
|---|---|---|
| committer | Carlos Maiolino <cem@kernel.org> | 2026-08-10 08:45:28 +0200 |
| commit | a94e648f03cf4e0def8ab3c74a1f9fe140720dd4 (patch) | |
| tree | 7466d568834effcae0bb76a2987abd7c1ffb981d /include/linux/bnge/git@git.tavy.me:linux.git | |
| parent | 0241ea5fb0fe86d2a673163b2f5815111aadc7f7 (diff) | |
xfs: use file target for post-log fsync fallback flush
xfs_file_fsync() has a fallback flush for the case where the log force
was a no-op, for example fdatasync/O_DSYNC writes that do not require
metadata updates. The current fallback path is expressed in terms of the
main data device and explicitly excludes realtime inodes.
Realtime files with a separate realtime device are flushed before the log
force, because their data must reach stable storage before the log commit.
For the internal realtime device used by the zoned allocator, writes are
out-of-place and update inode and bmap metadata from I/O completion, so
the overwrite-without-metadata-update case does not apply in the same way.
Even so, the current fallback condition is inconsistent because it is
expressed as "non-realtime inode on the main data device" rather than in
terms of the inode's actual file data target.
Use xfs_inode_buftarg() to obtain the target that stores this file's
data, and issue the fallback flush when the log force did not flush
anything and the log target is the same as that file target.
This preserves existing behavior for regular files while making the
fallback logic consistent for files whose data target is selected by the
inode.
Fixes: bdc03eb5f98f ("xfs: allow internal RT devices for zoned mode")
Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
Suggested-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Diffstat (limited to 'include/linux/bnge/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
