Changing the grace period

J. Bruce Fields bfields at fieldses.org
Mon Jun 4 12:27:08 EDT 2007


On Mon, Jun 04, 2007 at 11:55:29AM -0400, Avishay Traeger wrote:
> I have a few questions about changing the grace period (I want to make
> it shorter for testing purposes since 90 seconds is annoying).
> 
> 1. Is there any way to do this without modifying the code?  From what I
> can see, there isn't.

If I remember correctly, the way it's supposed to work is you write to
/proc/fs/nfsd/nfsv4leasetime, then restart nfsd, and the new lease time
will take effect on the restart.

> 2. I looked at ways to change the lease times, because grace_time relies
> on those.  In 2.6.22-rc3, in nfsctl.c line 591, it says:
> extern time_t nfs4_leasetime(void);
> 
> >From what I can tell, this is a typo,

Yes, looks like it.

> and should be nfs4_lease_time
> (underscore between "lease" and "time").  Correct?

I think that declaration shouldn't be there at all.

> 3. Also, the proc file doesn't seem to be functioning properly:
> [root at v4server]# echo 80 > /proc/fs/nfsd/nfsv4leasetime 
> [root at v4server]# cat /proc/fs/nfsd/nfsv4leasetime 
> 90
> In addition, nothing is printed in dmesg after the echo (probably
> related to that typo?).

It will show the new value after a reboot.  I agree that that's
confusing.

> 4. The comment in write_leasetime() says:
> /* if size > 10 seconds, call
>  * nfs4_reset_lease() then write out the new lease (seconds) as reply
>  */
> However, nfs4_reset_lease() changes the user_lease_time variable.  The
> print statement calls nfs4_lease_time() which prints the lease_time
> variable.  So it looks like you are changing one variable and then
> printing the other.  Is this intentional?

Yes, so it's the comment that's wrong.  But maybe we should be doing
this differently.

--b.


More information about the NFSv4 mailing list