linux/fs/cachefiles
Zizhi Wo 679d7276d4 cachefiles: Fix missing pos updates in cachefiles_ondemand_fd_write_iter()
[ Upstream commit 56f4856b42 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-14 19:53:15 +01:00
..
cache.c cachefiles: fix slab-use-after-free in cachefiles_withdraw_cookie() 2024-07-25 09:49:21 +02:00
daemon.c cachefiles: add missing lock protection when polling 2024-07-18 13:18:32 +02:00
error_inject.c cachefiles: Add some error injection support 2022-01-07 13:40:56 +00:00
interface.c cachefiles: extract ondemand info field from cachefiles_object 2024-06-21 14:35:46 +02:00
internal.h cachefiles: cyclic allocation of msg_id to avoid reuse 2024-07-18 13:18:32 +02:00
io.c cachefiles: implement on-demand read 2022-05-18 00:11:18 +08:00
Kconfig cachefiles: notify the user daemon when looking up cookie 2022-05-18 00:11:17 +08: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-10-17 15:22:01 +02:00
ondemand.c cachefiles: Fix missing pos updates in cachefiles_ondemand_fd_write_iter() 2024-12-14 19:53:15 +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-25 09:49:21 +02:00
xattr.c cachefiles: propagate errors from vfs_getxattr() to avoid infinite loop 2024-07-18 13:18:31 +02:00