WSL2-Linux-Kernel/fs/kernfs
Ivan Vecera 650d3d8512 kernfs: fix regression in kernfs_fop_write caused by wrong type
commit ba87977a49 upstream.

Commit b7ce40cff0 ("kernfs: cache atomic_write_len in
kernfs_open_file") changes type of local variable 'len' from ssize_t
to size_t. This change caused that the *ppos value is updated also
when the previous write callback failed.

Mentioned snippet:
...
len = ops->write(...); <- return value can be negative
...
if (len > 0)           <- true here in this case
        *ppos += len;
...

Fixes: b7ce40cff0 ("kernfs: cache atomic_write_len in kernfs_open_file")
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 20:22:59 +01:00
..
Kconfig kernfs: add CONFIG_KERNFS 2014-02-07 16:08:57 -08:00
Makefile sysfs, kernfs: add skeletons for kernfs 2013-11-27 13:28:24 -08:00
dir.c kernfs: introduce kernfs_node_id 2017-07-29 09:00:03 -06:00
file.c kernfs: fix regression in kernfs_fop_write caused by wrong type 2018-02-16 20:22:59 +01:00
inode.c kernfs: introduce kernfs_node_id 2017-07-29 09:00:03 -06:00
kernfs-internal.h kernfs: don't set dentry->d_fsdata 2017-07-29 09:00:03 -06:00
mount.c kernfs: checking for IS_ERR() instead of NULL 2017-09-01 08:17:55 -06:00
symlink.c kernfs: don't set dentry->d_fsdata 2017-07-29 09:00:03 -06:00