Re: [PATCH 3/9] iov_iter: overlay struct iovec and ubuf/len

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 thing

On Tue, Mar 28, 2023 at 3:19 PM Jens Axboe <axboe@xxxxxxxxx> wrote:
>
> Nobody should use it, though. The one case where I thought we'd use
> it was iov_iter_iovec(), but that doesn't work...

You only think that because all your conversions are bogus and wrong.

Your latest "[PATCH 7/9] ALSA: pcm.. " patch is just wrong.

Doing this:

-       if (!iter_is_iovec(from))
+       if (!from->user_backed)

does not work AT ALL. You also need to switch all the uses of
"from->iov" to use the "iter_iov()" helper (that you didn't use).

Because "from->iov" is _only_ valid as a iov pointer for an ITER_IOV.

For an ITER_UBUF, that will be the user pointer in the union, and to
get the iov, you need to do that

    iov = &from->ubuf_iov

thing.

The "overlay ubuf as an iov" does *not* make "from->iov" work at all.
Really. You still need to *generate* that pointer from the overlaid
data.

So your latest patches may build, but they most definitely won't work.

I would in fact suggest renaming the "iov" member entirely, to make
sure that nobody uses the "direct access" model ever.

           Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux