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