]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ext4: disambiguate the return value of ext4_dio_write_end_io()
authorJinliang Zheng <alexjlzheng@tencent.com>
Thu, 19 Sep 2024 08:25:39 +0000 (16:25 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Nov 2024 04:54:14 +0000 (23:54 -0500)
commit25f51ea8ac8144af2fefb743c3439547610368ff
tree572ff8922f99044e71639799628bb1b54fb292ac
parent813f85360404028cd8340ae7f7f77abc68c86fbc
ext4: disambiguate the return value of ext4_dio_write_end_io()

The commit 91562895f803 ("ext4: properly sync file size update after O_SYNC
direct IO") causes confusion about the meaning of the return value of
ext4_dio_write_end_io().

Specifically, when the ext4_handle_inode_extension() operation succeeds,
ext4_dio_write_end_io() directly returns count instead of 0.

This does not cause a bug in the current kernel, but the semantics of the
return value of the ext4_dio_write_end_io() function are wrong, which is
likely to introduce bugs in the future code evolution.

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20240919082539.381626-1-alexjlzheng@tencent.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/file.c