Ivan Vecera ba87977a49 kernfs: fix regression in kernfs_fop_write caused by wrong type
Commit b7ce40cff0b9 ("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: b7ce40cff0b9 ("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>
2018-01-19 12:19:13 -05:00
..
2017-11-16 11:41:22 -08:00
2017-11-15 18:21:06 -08:00
2017-11-15 18:21:04 -08:00
2017-08-24 13:23:03 -07:00
2017-11-14 14:44:04 -08:00
2017-11-17 09:51:57 -08:00
2017-11-16 12:10:21 -08:00
2017-11-16 11:41:22 -08:00
2017-11-17 09:51:57 -08:00
2017-11-14 13:53:18 -08:00
2017-11-18 11:22:04 -08:00
2017-11-17 14:18:00 -08:00
2017-11-18 11:22:04 -08:00
2017-11-22 20:42:42 -10:00
2017-09-04 19:05:15 -04:00
2017-04-17 12:52:27 -04:00
2017-11-17 09:51:57 -08:00
2017-11-15 18:21:04 -08:00
2017-06-22 11:44:55 -04:00
2017-12-09 20:16:33 -05:00