On Wed, 2023-11-15 at 08:04 -0500, Benjamin Coddington wrote: > 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. > Thank you! I'll queue that patch up so it gets included in the next bugfix pull request. I agree that we should get rid of the bytes_left field. We can queue something up for that in the next merge window. -- Trond Myklebust Linux NFS client maintainer, Hammerspace trond.myklebust@xxxxxxxxxxxxxxx