Re: [PATCH v3 2/3] nfsd: Initial implementation of NFSv4 Courteous Server
From: dai.ngo@oracle.com
Date: 2021-09-24 20:53:24
Also in:
linux-fsdevel
On 9/23/21 12:32 PM, J. Bruce Fields wrote:
On Thu, Sep 23, 2021 at 10:09:35AM -0700, dai.ngo@oracle.com wrote:quoted
On 9/22/21 6:34 PM, J. Bruce Fields wrote:quoted
On Thu, Sep 16, 2021 at 02:22:11PM -0400, Dai Ngo wrote:quoted
+/* + * 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.quoted
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.
Yes, local lease breakers use (!O_NONBLOCK). In this case __break_lease will call lm_break then wait for all lease conflicts to be resolved before returning to caller. -Dai
--b.