Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1063088 - nfs init script does not take into account that nfsd modifies the grace time
nfs init script does not take into account that nfsd modifies the grace time
Status: CLOSED DUPLICATE of bug 1058354
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: nfs-utils (Show other bugs)
6.5
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-09 19:31 EST by Dennis Jacobfeuerborn
Modified: 2017-03-17 07:37 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-04-22 10:25:31 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dennis Jacobfeuerborn 2014-02-09 19:31:15 EST
nfsd modifies the grace time for nfsv4 in magic ways:
https://bugzilla.redhat.com/show_bug.cgi?id=1063087

As a result of this the NFSD_V4_GRACE variable in /etc/sysconfig/nfs does not work as expected.
Since nfsd enforces that the grace time is always >= the lease time the lease time also needs to be changed together with the grace time in the init script. Since this does not happen at the moment the expected grace time will only be set for a few seconds after the nfs service is started and then reset by nfsd to the value of /proc/fs/nfsd/nfsv4leasetime.

So the following code from the init script:

        # Set v4 grace period if requested
        [ -n "$NFSD_V4_GRACE" ] && {
                echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4gracetime
        }

needs to be changed to this:

        # Set v4 grace period if requested
        [ -n "$NFSD_V4_GRACE" ] && {
                echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4leasetime
                echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4gracetime
        }

This is the easiest fix. A more correct one would probably remove the NFSD_V4_GRACE variable entirely and replace it with a NFSD_V4_LEASE variable and then derive the grace time from that (e.g. grace time = lease time + padding) sind the grace time should always be at least the same as the lease time but probably a bit larger (which is what nfsd now apparently enforces).
Comment 3 Steve Dickson 2015-02-20 09:46:16 EST
(In reply to Dennis Jacobfeuerborn from comment #0)
> nfsd modifies the grace time for nfsv4 in magic ways:
> https://bugzilla.redhat.com/show_bug.cgi?id=1063087
> 
> As a result of this the NFSD_V4_GRACE variable in /etc/sysconfig/nfs does
> not work as expected.
> Since nfsd enforces that the grace time is always >= the lease time the
> lease time also needs to be changed together with the grace time in the init
> script. Since this does not happen at the moment the expected grace time
> will only be set for a few seconds after the nfs service is started and then
> reset by nfsd to the value of /proc/fs/nfsd/nfsv4leasetime.
> 
> So the following code from the init script:
> 
>         # Set v4 grace period if requested
>         [ -n "$NFSD_V4_GRACE" ] && {
>                 echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4gracetime
>         }
> 
> needs to be changed to this:
> 
>         # Set v4 grace period if requested
>         [ -n "$NFSD_V4_GRACE" ] && {
>                 echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4leasetime
>                 echo "$NFSD_V4_GRACE" > /proc/fs/nfsd/nfsv4gracetime
>         }
> 
Why not just set NFSD_V4_LEASE to the same value of NFSD_V4_GRACE?
Comment 4 Dennis Jacobfeuerborn 2015-02-20 11:50:59 EST
NFSD_V4_LEASE doesn't seem to exists:

[root@nfs1a ~]# grep LEASE /etc/sysconfig/nfs 
[root@nfs1a ~]# grep LEASE /etc/init.d/nfs
[root@nfs1a ~]#
Comment 5 Steve Dickson 2015-04-22 10:25:31 EDT
(In reply to Dennis Jacobfeuerborn from comment #4)
> NFSD_V4_LEASE doesn't seem to exists:
> 
> [root@nfs1a ~]# grep LEASE /etc/sysconfig/nfs 
> [root@nfs1a ~]# grep LEASE /etc/init.d/nfs
> [root@nfs1a ~]#

It was added to the nfs-utils-1.2.3-48.el6 version:

rhel6$ grep LEASE /etc/sysconfig/nfs
# NFSD_V4_LEASE was on the previous boot.
# first make NFSD_V4_LEASE shorter, then restart server. 
#NFSD_V4_LEASE=90

rhel6$ grep LEASE /etc/init.d/nfs
	[ -n "$NFSD_V4_LEASE" ] && {
		echo "$NFSD_V4_LEASE" > /proc/fs/nfsd/nfsv4leasetime
rhel6$

see bug 1058354

*** This bug has been marked as a duplicate of bug 1058354 ***

Note You need to log in before you can comment on or make changes to this bug.