On 9/15/21 12:32 PM, Linus Torvalds wrote: > On Wed, Sep 15, 2021 at 9:29 AM Jens Axboe <axboe@xxxxxxxxx> wrote: >> >> I've run this through vectored read/write with io_uring on the commonly >> problematic cases (dm and low depth SCSI device) which trigger these >> conditions often, and it seems to pass muster. I've also hacked in >> faked randomly short reads and that helped find on issue with double >> accounting. But it did validate the state handling otherwise. > > Ok, so I can't see anything obviously wrong with this, or anything I > can object to. It's still fairly complicated, and I don't love how > hard it is to follow some of it, but I do believe it's better. OK good > IOW, I don't have any objections. Al was saying he was looking at the > io_uring code, so maybe he'll find something. > > Do you have these test-cases as some kind of test-suite so that this > all stays correct? Yep liburing has a whole bunch of regressions tests that we always run for any change, and new cases are added as problems are found. That also has test cases for new features, etc. This one is particularly difficult to test and have confidence in, which is why I ended up hacking up that faked short return so I knew I had exercised all of it. The usual tests do end up hitting the -EAGAIN path quite easily for certain device types, but not the short read/write. -- Jens Axboe