Re: [git pull] iov_iter fixes

From: Linus Torvalds
Date: Fri Sep 10 2021 - 13:31:22 EST


On Fri, Sep 10, 2021 at 10:26 AM Jens Axboe <axboe@xxxxxxxxx> wrote:
>
> On 9/10/21 10:58 AM, Linus Torvalds wrote:
> > On Fri, Sep 10, 2021 at 9:56 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
> >>
> >> What's the point of all those contortions, anyway? You only need it for
> >> iovec case; don't mix doing that and turning it into flavour-independent
> >> primitive.
> >
> > Good point, making it specific to iovec only gets rid of a lot of
> > special cases and worries.
> >
> > This is fairly specialized, no need to always cater to every possible case.
>
> Alright, split into three patches:
>
> https://git.kernel.dk/cgit/linux-block/log/?h=iov_iter

That looks sane to me.

Please add some comment about how that

i->iov -= state->nr_segs - i->nr_segs;

actually is the right thing for all the three cases (iow how 'iov',
'kvec' and 'bvec' all end up having a union member that acts the same
way).

But yeah, I like how the io_uring.c code looks better this way too.

Al, what do you think?

Linus