Re: [git pull] iov_iter fixes

From: Al Viro
Date: Thu Sep 09 2021 - 23:36:17 EST


On Thu, Sep 09, 2021 at 09:30:03PM -0600, Jens Axboe wrote:

> > Again, we should never, ever modify the iovec (or bvec, etc.) array in
> > ->read_iter()/->write_iter()/->sendmsg()/etc. instances. If you see
> > such behaviour anywhere, report it immediately. Any such is a blatant
> > bug.
>
> Yes that was wrong, the iovec is obviously const. But that really
> doesn't change the original point, which was that copying the iov_iter
> itself unconditionally would be miserable.

Might very well be true, but... won't your patch hit the reimport on
every short read? And the cost of uaccess in there is *much* higher
than copying of 48 bytes into local variable...

Or am I misreading your patch? Note that short reads on reaching
EOF are obviously normal - it's not a rare case at all.