aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/sched-migration.py
diff options
context:
space:
mode:
authorZizhi Wo <[email protected]>2025-07-03 02:44:18 +0000
committerChristian Brauner <[email protected]>2025-07-10 07:40:17 +0000
commit6b89819b06d8d339da414f06ef3242f79508be5e (patch)
tree838b50fb57b7a9d400090a0d5fa21fbe42accf5c /tools/perf/scripts/python/sched-migration.py
parentsecretmem: use SB_I_NOEXEC (diff)
downloadkernel-6b89819b06d8d339da414f06ef3242f79508be5e.tar.gz
kernel-6b89819b06d8d339da414f06ef3242f79508be5e.zip
cachefiles: Fix the incorrect return value in __cachefiles_write()
In __cachefiles_write(), if the return value of the write operation > 0, it is set to 0. This makes it impossible to distinguish scenarios where a partial write has occurred, and will affect the outer calling functions: 1) cachefiles_write_complete() will call "term_func" such as netfs_write_subrequest_terminated(). When "ret" in __cachefiles_write() is used as the "transferred_or_error" of this function, it can not distinguish the amount of data written, makes the WARN meaningless. 2) cachefiles_ondemand_fd_write_iter() can only assume all writes were successful by default when "ret" is 0, and unconditionally return the full length specified by user space. Fix it by modifying "ret" to reflect the actual number of bytes written. Furthermore, returning a value greater than 0 from __cachefiles_write() does not affect other call paths, such as cachefiles_issue_write() and fscache_write(). Fixes: 047487c947e8 ("cachefiles: Implement the I/O routines") Signed-off-by: Zizhi Wo <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/sched-migration.py')
0 files changed, 0 insertions, 0 deletions