]> git.baikalelectronics.ru Git - kernel.git/commit
__generic_file_write_iter: keep ->ki_pos and return value consistent
authorAl Viro <viro@zeniv.linux.org.uk>
Tue, 7 Apr 2015 14:22:53 +0000 (10:22 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 12 Apr 2015 02:29:47 +0000 (22:29 -0400)
commitb73bfea5af99a5b1bf8f23a83a060f7846dab2d7
treeb9f8769682257d9a8ec4ccb0a3253d021fd68ce8
parenteb01a467dde46b343d9dca62bda67f81a19e0292
__generic_file_write_iter: keep ->ki_pos and return value consistent

A side effect worth noting: in O_APPEND case we set ->ki_pos early,
so if it turns out to be an error or a zero-length write, we'll
end up with ->ki_pos modified.  Safe, since all callers never
look at the ->ki_pos after the call of __generic_file_write_iter()
returning non-positive, all the way to caller of ->write_iter() and
those discard ->ki_pos when getting that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
mm/filemap.c