Bug 9619 - [nfs] Restarting mountd kills existing mounts
Summary: [nfs] Restarting mountd kills existing mounts
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 3.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
: 131342 206855 (view as bug list)
Depends on:
Blocks:
 
Reported: 1999-01-22 22:40 UTC by David E. Cross
Modified: 2018-05-28 20:32 UTC (History)
5 users (show)

See Also:
rmacklem: mfc-stable11+
rmacklem: mfc-stable10+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David E. Cross 1999-01-22 22:40:00 UTC
Restarting mountd (via kill and restart or HUP-ing the process) will
temporarily cause all existing mounts to be denied access, and new mounts to
be refused with a 'permission denied' error.

Fix: 

None known.
How-To-Repeat: 2 Machines, a NFS server, and a NFS client.  Create a simple '/etc/exports'
file on the server and start NFS services (nfsd, mountd, etc...).  Mount an
exported partion on the client (e.g. "mount server:/export /mnt").  Start a
tar of that directory on the client (should be alot of files in order to give
you time to complete all of these steps.) (e.g. "tar -cpf /dev/null /mnt").
While the tar is still running on the client, send the mount daemon on the
server a SIGHUP (e.g. "kill -HUP <mountdPID>").  Now watch the permission
denied error messages scroll by on the client.
Comment 1 mjacob 2000-10-29 18:25:03 UTC
This is still a problem in -current. It's quite annoying.
Comment 2 Craig Rodrigues freebsd_committer freebsd_triage 2006-05-23 07:22:18 UTC
Responsible Changed
From-To: freebsd-bugs->rodrigc

Mine.
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 01:50:32 UTC
State Changed
From-To: open->open

commit bit has been taken in for safekeeping. 


Comment 4 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 01:50:32 UTC
Responsible Changed
From-To: rodrigc->freebsd-bugs
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2013-07-03 02:35:32 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 6 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:59:16 UTC
I'm pretty sure this is no longer the case (well, at least with HUP). Rick: can you confirm?
Comment 7 Rick Macklem freebsd_committer freebsd_triage 2015-11-10 13:38:49 UTC
In recent versions of FreeBSD, mountd has the "-S" option,
which can be used to avoid this from happening. It suspends/resumes
the nfsd threads while it is reloading the exports.

Some have suggested that it should be enabled by default, but others
felt that would be a POLA violation (since all NFS services stop during
the suspend), so it has never been made the default and must be
enabled via the "-S" option.
Comment 8 Rick Macklem freebsd_committer freebsd_triage 2016-02-05 00:54:05 UTC
*** Bug 206855 has been marked as a duplicate of this bug. ***
Comment 9 Rick Macklem freebsd_committer freebsd_triage 2016-02-05 00:57:36 UTC
I have left this open since I do have a 2 line patch that
ensures that "mountd -S" isn't delayed by heavy server load.
The patch gives the "suspend" priority over regular nfs requests
instead of waiting until there are no outstanding RPCs before
doing the suspend. (This patch is not yet in -head.)
Comment 10 Rick Macklem freebsd_committer freebsd_triage 2016-02-05 01:00:04 UTC
*** Bug 131342 has been marked as a duplicate of this bug. ***
Comment 11 commit-hook freebsd_committer freebsd_triage 2016-05-08 20:10:33 UTC
A commit references this bug:

Author: rmacklem
Date: Sun May  8 20:10:23 UTC 2016
New revision: 299242
URL: https://svnweb.freebsd.org/changeset/base/299242

Log:
  Make "-S" a default option for mountd.

  After a discussion on freebsd-fs@ there seemed to be a consensus that
  the "-S" option for mountd should become the default.
  Since the only known issue w.r.t. using "-S" was fixed by r299201,
  this commit adds "-S" to the default mountd_flags.

  Discussed on:	freebsd-fs
  PR:		9619, 131342, 206855
  MFC after:	2 weeks
  Relnotes:	yes

Changes:
  head/etc/defaults/rc.conf
Comment 12 Eitan Adler freebsd_committer freebsd_triage 2018-05-28 19:42:23 UTC
batch change:

For bugs that match the following
-  Status Is In progress 
AND
- Untouched since 2018-01-01.
AND
- Affects Base System OR Documentation

DO:

Reset to open status.


Note:
I did a quick pass but if you are getting this email it might be worthwhile to double check to see if this bug ought to be closed.
Comment 13 Rick Macklem freebsd_committer freebsd_triage 2018-05-28 20:32:23 UTC
The "-S" mountd option fixes this and r299201 has been MFC'd to 10 and 11.