android_kernel_samsung_univ.../fs/kernfs
Ivan Vecera f1db1b8055 kernfs: fix regression in kernfs_fop_write caused by wrong type
commit ba87977a49913129962af8ac35b0e13e0fa4382d 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:09:42 +01:00
..
dir.c kernfs: implement kernfs_path_len() 2015-08-18 15:49:15 -07:00
file.c kernfs: fix regression in kernfs_fop_write caused by wrong type 2018-02-16 20:09:42 +01:00
inode.c
Kconfig
kernfs-internal.h
Makefile
mount.c
symlink.c