Skip to content
  • Al Viro's avatar
    __generic_file_write_iter: keep ->ki_pos and return value consistent · 0b8def9d
    Al Viro authored
    
    
    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>
    0b8def9d