linux/fs/cachefiles
Zizhi Wo 56f4856b42
cachefiles: Fix missing pos updates in cachefiles_ondemand_fd_write_iter()
In the erofs on-demand loading scenario, read and write operations are
usually delivered through "off" and "len" contained in read req in user
mode. Naturally, pwrite is used to specify a specific offset to complete
write operations.

However, if the write(not pwrite) syscall is called multiple times in the
read-ahead scenario, we need to manually update ki_pos after each write
operation to update file->f_pos.

This step is currently missing from the cachefiles_ondemand_fd_write_iter
function, added to address this issue.

Fixes: c838305450 ("cachefiles: notify the user daemon when looking up cookie")
Signed-off-by: Zizhi Wo <wozizhi@huawei.com>
Link: https://lore.kernel.org/r/20241107110649.3980193-3-wozizhi@huawei.com
Acked-by: David Howells <dhowells@redhat.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-11-11 14:39:38 +01:00
..
cache.c cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie() 2024-07-03 10:36:15 +02:00
daemon.c Merge patch series "cachefiles: random bugfixes" 2024-07-05 18:40:40 +02:00
error_inject.c cachefiles: Remove the now superfluous sentinel element from ctl_table array 2023-12-28 04:57:57 -08:00
interface.c cachefiles: extract ondemand info field from cachefiles_object 2023-11-25 16:03:57 +01:00
internal.h Merge patch series "cachefiles: random bugfixes" 2024-07-05 18:40:40 +02:00
io.c cachefiles, netfs: Fix write to partial block at EOF 2024-09-12 12:20:41 +02:00
Kconfig netfs, fscache: Combine fscache with netfs 2023-12-24 15:08:46 +00:00
key.c cachefiles: Implement key to filename encoding 2022-01-07 13:42:16 +00:00
main.c cachefiles: Implement object lifecycle funcs 2022-01-07 13:42:08 +00:00
Makefile cachefiles: notify the user daemon when looking up cookie 2022-05-18 00:11:17 +08:00
namei.c cachefiles: fix dentry leak in cachefiles_open_file() 2024-09-27 18:29:19 +02:00
ondemand.c cachefiles: Fix missing pos updates in cachefiles_ondemand_fd_write_iter() 2024-11-11 14:39:38 +01:00
security.c cachefiles: Add security derivation 2022-01-07 13:41:14 +00:00
volume.c cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie() 2024-07-03 10:36:15 +02:00
xattr.c cachefiles: Fix non-taking of sb_writers around set/removexattr 2024-09-05 11:00:40 +02:00