Skip to content
Commit 0b8def9d authored by Al Viro's avatar Al Viro
Browse files

__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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e9d1593d
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment