Re: [PATCH v5 04/21] nfsd: allow nfsd to get a dir lease with an ignore mask

"Chuck Lever" <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.documentation,gmane.linux.nfs
Message-ID <[email protected]>
On Fri, May 22, 2026, at 3:42 PM, Jeff Layton wrote:
> When requesting a directory lease, enable the FL_IGN_DIR_* bits that
> correspond to the requested notification types.

> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 67e163ee13a2..2a34ba457b74 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c

> @@ -9642,12 +9657,11 @@ nfsd_get_dir_deleg(struct nfsd4_compound_state *cstate,
>  		dp->dl_stid.sc_export =
>  			exp_get(cstate->current_fh.fh_export);
> 
> -	fl = nfs4_alloc_init_lease(dp);
> +	fl = nfs4_alloc_init_lease(dp, gdd->gddr_notification[0]);

Both Sashiko and my own gpt-5.5 review noted the use of a response field
here rather than a request field, but that is a false positive finding.
The commit message needs to explain why the use of gddr_notification[0]
is correct.


>  	if (!fl)
>  		goto out_put_stid;
> 
> -	status = kernel_setlease(nf->nf_file,
> -				 fl->c.flc_type, &fl, NULL);
> +	status = kernel_setlease(nf->nf_file, fl->c.flc_type, &fl, NULL);
>  	if (fl)
>  		locks_free_lease(fl);
>  	if (status)

This last edit appears to be a clean-up that is unrelated to the purpose
of the patch.


-- 
Chuck Lever
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.