On Fri, Sep 17, 2021 at 08:44:32AM -0600, Jens Axboe wrote: > Hi Linus, > > This adds a helper to save/restore iov_iter state, and modifies io_uring > to use it. After that is done, we can kill the iter->truncated addition > that we added for this release. The io_uring change is being overly > cautious with the save/restore/advance, but better safe than sorry and > we can always improve that and reduce the overhead if it proves to be of > concern. The only case to be worried about in this regard is huge IO, > where iteration can take a while to iterate segments. > > I spent some time writing test cases, and expanded the coverage quite a > bit from the last posting of this. liburing carries this regression test > case now: > > https://git.kernel.dk/cgit/liburing/tree/test/file-verify.c > > which exercises all of this. It now also supports provided buffers, and > explicitly tests for end-of-file/device truncation as well. > > On top of that, Pavel sanitized the IOPOLL retry path to follow the > exact same pattern as normal IO. I can live with that; I do have problems with io-uring and its interactions with iov_iter, but those are mostly independent from the stuff you are doing here. Still digging through your FSM from hell... ;-/