On Thu, Sep 23, 2021 at 10:09:35AM -0700, dai.ngo@xxxxxxxxxx wrote: > On 9/22/21 6:34 PM, J. Bruce Fields wrote: > >On Thu, Sep 16, 2021 at 02:22:11PM -0400, Dai Ngo wrote: > >>+/* > >>+ * If the conflict happens due to a NFSv4 request then check for > >>+ * courtesy client and set rq_conflict_client so that upper layer > >>+ * can destroy the conflict client and retry the call. > >>+ */ > >I think we need a different approach. > > I think nfsd_check_courtesy_client is used to handle conflict with > delegation. So instead of using rq_conflict_client to let the caller > knows and destroy the courtesy client as the current patch does, we > can ask the laundromat thread to do the destroy. I can't see right now why that wouldn't work. > In that case, > nfs4_get_vfs_file in nfsd4_process_open2 will either return no error > since the the laufromat destroyed the courtesy client or it gets > get nfserr_jukebox which causes the NFS client to retry. By the time > the retry comes the courtesy client should already be destroyed. Make sure this works for local (non-NFS) lease breakers as well. I think that mainly means making sure the !O_NONBLOCK case of __break_lease works. --b.