Re: [PATCH v2 3/3] nfsd: keep a tally of RECLAIM_COMPLETE operations when using nfsdcld

J. Bruce Fields
2018-12-19T17:46:49Z

On Tue, Dec 18, 2018 at 09:29:26AM -0500, Scott Mayhew wrote:
> +skip_grace:
> + printk(KERN_INFO "NFSD: no clients to reclaim, skipping NFSv4 grace period (net %x)\n",
> + net->ns.inum);
> + queue_delayed_work(laundry_wq, &nn->laundromat_work, nn->nfsd4_lease * HZ);
> + /*
> + * we could call nfsd4_end_grace() here, but it has a dprintk()
> + * that would be confusing if debug logging is enabled
> + */

In that case, I'd rather pull the dprintk out of nfsd4_end_grace into
its only other caller (nfs4_laundromat), instead of duplicating this
stuff.

> + nn->grace_ended = true;
> + nfsd4_record_grace_done(nn);
> + locks_end_grace(&nn->nfsd4_manager);

(Yes, it's only three lines, but it's a little subtle, I'd rather have
it all in one place.)

--b.

> + return 0;
> }
>
> /* initialization to perform when the nfsd service is started: */
> diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
> index 6384c9b94898..950ac6683be9 100644
> --- a/fs/nfsd/nfsctl.c
> +++ b/fs/nfsd/nfsctl.c
> @@ -1240,6 +1240,7 @@ static __net_init int nfsd_init_net(struct net *net)
> nn->nfsd4_lease = 45; /* default lease time */
> nn->nfsd4_grace = 45;
> nn->somebody_reclaimed = false;
> + nn->track_reclaim_completes = false;
> nn->clverifier_counter = prandom_u32();
> nn->clientid_counter = prandom_u32();
> nn->s2s_cp_cl_id = nn->clientid_counter++;
> --
> 2.17.1