On 9 Nov 2023, at 12:25, Benjamin Coddington wrote: > On 9 Nov 2023, at 11:53, Trond Myklebust wrote: >> >> Hi Ben, >> >> Relying on the value of dreq->bytes_left is just not a good idea, given >> that the layoutget request could end up returning NFS4ERR_DELAY. >> >> How about something like the following patch? > > That looks promising! I think ->bytes_left could get dropped after this. > > I'll send it through some testing and report back, thanks! This definitely fixes it, sorry for the delay getting back. Fixes: 954998b60caa ("NFS: Fix error handling for O_DIRECT write scheduling") Reviewed-by: Benjamin Coddington <bcodding@xxxxxxxxxx> Tested-by: Benjamin Coddington <bcodding@xxxxxxxxxx> It creates some clear additional work to remove nfs_direct_req->bytes_left (I don't think its needed anymore) and fixup the nfs_direct_req_class tracepoint, which could be a follow-up patch or get folded in. Ben