# Re: \[PATCH v2 08/17\] {macvtap,tun}\_get\_user(): switch to iov\_iter

- From: Michael S. Tsirkin \<mst@redhat.com\>
- Date: 2015-02-03 15:19:31 
- List: netdev
- Page: https://ratatoskr.run/netdev/2015/02/4424409
- Thread: https://ratatoskr.run/netdev/2014/11/4376449/t/2.md

```text
On Tue, Feb 03, 2015 at 02:27:28PM +0000, Al Viro wrote:
> On Tue, Feb 03, 2015 at 12:10:44PM +0200, Michael S. Tsirkin wrote:
> 
> > Hmm does copy_from_iter actually modify the iovec?
> > If so, won't this break aio on tun/macvtap, by
> > reversing the effect of
> > commit 6f26c9a7555e5bcca3560919db9b852015077dae
> >     tun: fix tun_chr_aio_write so that aio works
> > ?
> > 
> > 
> > Maybe we should change iovec_iter to avoid modifying the
> > underlying iovec?
> 
> iov_iter never changes the underlying iovec (or kvec, or bvec).
> iter->iov_offset changes as you go and once you have consumed an
> entire iovec element ->iov is incremented to point to the next one
> (and ->iov_offset is reset to 0 at that point).  *Contents* of
> iter->iov is never modified.

I see, I think I misread the code.
Thanks for the clarification.

-- 
MST
```
