Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1063087 - nfsd magically changes /proc/fs/nfsd/nfsv4gracetime
nfsd magically changes /proc/fs/nfsd/nfsv4gracetime
Status: CLOSED CURRENTRELEASE
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
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-09 19:19 EST by Dennis Jacobfeuerborn
Modified: 2017-03-17 07:36 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-21 12:34:27 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:19:52 EST
After some debugging of a nfs cluster setup i discovered that nfsd seems to mess secretly with the /proc/fs/nfsd/nfsv4gracetime value.

If the nfsv4leasetime is larger than nfsv4gracetime then after a few seconds the daemon seem to automatically set the gracetime to the value of the leasetime. It does this without printing a warning to the logs or informing the admin of the system. 

While the behaviour makes sense given the meaning of these variables the magic way nfsd handles this makes debugging of gracetime issues a nightmare.
This also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs.

I see too solutions here:

1) Since nfsd insists on gracetime >= leasetime an attempt to set gracetime to anything lower than the leasetime should result in an immediate error. This way the constraints are enforced in a better way (the current approach is racy) and there is no magical behaviour anymore making the admins life easier.

2) If the above is not possible for some reason then nfsd should at least print an warning to the syslog that it adjusted the value. That way the admin at least knows what is going on and does not have to go on a quest t find out who/what keeps resetting the gracetime.

I noticed this on a CentOS 6.5 system.
Comment 3 J. Bruce Fields 2015-02-20 10:03:38 EST
Yes, this was a stupid idea on my part, apologies, recently fixed.  Maybe we should backport the following.

commit bea57fe45ba2
Author: J. Bruce Fields <bfields@redhat.com>
Date:   Mon Sep 15 11:05:46 2014 -0400

    nfsd4: stop grace_time update at end of grace period
    
    The attempt to automatically set a new grace period time at the end of
    the grace period isn't really helpful.  We'll probably shut down and
    reboot before we actually make use of the new grace period time anyway.
    So may as well leave it up to the init system to get this right.
    
    This just confuses people when they see /proc/fs/nfsd/nfsv4gracetime
    change from what they set it to.
    
    Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Comment 4 J. Bruce Fields 2015-02-20 10:05:58 EST
That said, that's mainly a cosmetic change, the enforced grace period should still be what you asked for, so I'm a little concerned to hear you say "This also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs."

Steved, does 6.5 have the logic that uses NFSD_V4_GRACE to set the nlm grace period too?
Comment 5 Steve Dickson 2015-03-05 13:49:30 EST
(In reply to J. Bruce Fields from comment #4)
> That said, that's mainly a cosmetic change, the enforced grace period should
> still be what you asked for, so I'm a little concerned to hear you say "This
> also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs."
> 
> Steved, does 6.5 have the logic that uses NFSD_V4_GRACE to set the nlm grace
> period too?
Yes it does... but it only sets nfsv4gracetime not nfsv4leasetime.
That was fixed in RHEL6.6 with the fix to bz1058354
Comment 6 Steve Dickson 2015-10-21 12:34:27 EDT
(In reply to Steve Dickson from comment #5)
> (In reply to J. Bruce Fields from comment #4)
> > That said, that's mainly a cosmetic change, the enforced grace period should
> > still be what you asked for, so I'm a little concerned to hear you say "This
> > also effectively breaks the NFSD_V4_GRACE variable in /etc/sysconfig/nfs."
> > 
> > Steved, does 6.5 have the logic that uses NFSD_V4_GRACE to set the nlm grace
> > period too?
> Yes it does... but it only sets nfsv4gracetime not nfsv4leasetime.
> That was fixed in RHEL6.6 with the fix to bz1058354

This seems to be fixed... closing the bz.
Comment 7 Tom Coughlan 2015-11-05 11:33:11 EST
Removing from the 68FileAndStorageRPL.

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