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

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

 



On Tue, Mar 28, 2023 at 2:58 PM Jens Axboe <axboe@xxxxxxxxx> wrote:
>
> +               struct iovec __ubuf_iovec;

This really should be "const struct iovec".

The only valid use for this is as an alternative to "iter->iov", and
that one is a 'const' pointer too:

> +                               const struct iovec *iov;

and any code that tries to use it as a non-const iovec entry really is
very very wrong.

And yes, the current infiniband/hw/hfi1/* code does indeed do all of
this wrong and cast the pointer to a non-const one, but that's
actually just because somebody didn't do the const conversion right.

That cast should just go away, and hfi1_user_sdma_process_request()
should just take a 'const struct iovec *iovec' argument.  It doesn't
actually want to write to it anyway, so it's literally just a "change
the prototype of the function" change.

              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