Re: [git pull] iov_iter fixes

From: Linus Torvalds
Date: Fri Sep 10 2021 - 15:04:52 EST


On Fri, Sep 10, 2021 at 11:50 AM Al Viro <viro@xxxxxxxxxxxxxxxxxx> wrote:
>
> I think that sizeof(struct bio_vec) != sizeof(struct iovec):

Ooh, very good catch.

That would cause some *very* odd and subtle errors, since it just
happens to work on 64-bit, and then causes very confusing pointer
arithmetic errors on 32-bit.

So yeah, that

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

doesn't work after all, comment or not.

So only 'struct iovec' and 'struct kvec' actually have the same format
and can be used interchangeably.

Linus