On Wed, Mar 29, 2023 at 11:41 AM Jens Axboe <axboe@xxxxxxxxx> wrote: > > Passes testing, and verified we do the right thing for 1 and multi > segments. Apart from the pointer casting rant, this looks sane to me. I feel like 02/11 has a few potential cleanups: (a) it feels like a few too many "iter.__iov" uses remaining, but they mostly (all?) look like assignments. I do get the feeling that any time you assign __iov, you should also assign "nr_segs", and it worries me a bit that I see one without the other. Maybe room for another helper that enforces a "if you set the __iov pointer, you must be setting nr_segs too"? And maybe I'm just being difficult. (b) I see at least one "iov = iter_iov(from)" that precedes a later check for "iter_is_iovec()", which again means that *if* we add some debug sanity test to "iter_iov()", it might trigger when it shouldn't? The one I see is in snd_pcm_writev(), but I th ink the same thing happens in snd_pcm_readv() but just isn't visible in the patch due to not having the context lines. Linus