On 3/30/22 6:43 AM, Miklos Szeredi wrote: > On Wed, 30 Mar 2022 at 14:35, Jens Axboe <axboe@xxxxxxxxx> wrote: >> >> On 3/30/22 2:18 AM, Miklos Szeredi wrote: >>> On Tue, 29 Mar 2022 at 22:03, Jens Axboe <axboe@xxxxxxxxx> wrote: >>> >>>> Can you try and repull the branch? I rebased the top two, so reset to >>>> v5.17 first and then pull it. >>> >>> This one works in all cases, except if there's a link flag on the >>> read. In that case the read itself will succeed but following >>> requests on the link chain will fail with -ECANCELED. >> >> That sounds like you're asking for more data than what is being read, >> in which case the link should correctly break and cancel the rest. >> That's expected behavior, a short read is not a successful read in that >> regard. > > Sorry, I don't get it. Does the link flag has other meaning than > "wait until this request completes before starting the next"? IOSQE_IO_LINK means "wait until this request SUCCESSFULLY completes before starting the next one". You can't reliably use a link from an eg read, if you don't know how much data it read. If you don't care about success, then use IOSQE_IO_HARDLINK. That is semantically like a link, but it doesn't break on an unexpected result. If you're using LINK from the read _and_ the read returns less than you asked for, IOSQE_IO_LINK will break the chain as that is an unexpected result. -- Jens Axboe