On 3/28/23 4:16 PM, Linus Torvalds wrote: > 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: True, it should. But as per the cover letter, this only really serves as a space filler, none of the code actually uses it. But let's make it const, because that is the right thing to do. >> + const struct iovec *iov; > > and any code that tries to use it as a non-const iovec entry really is > very very wrong. Nobody should use it, though. The one case where I thought we'd use it was iov_iter_iovec(), but that doesn't work... > 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. Let's leave that for the IB people! -- Jens Axboe