nfs-kernel-server mountd check only checks for nfsv3 via UDP, not TCP

Bug #1284210 reported by Christian Reis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I recently disabled UDP on our NFS server by setting --no-udp (or -U) and all of a sudden I could no longer get nfsv3 mounts to work. It turns out that this happens because of the check in /etc/init.d/nfs-kernel-server:

        rpcinfo -u localhost nfs 3 >/dev/null 2>&1 ||
                RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"

That line only uses rpcinfo -u, so disabling UDP breaks the check. It should probably be something like:

       rpcinfo -u localhost nfs 3 >/dev/null 2>&1 ||
                rpcinfo -t localhost nfs 3 >/dev/null 2>&1 ||
                RPCMOUNTDOPTS="$RPCMOUNTDOPTS --no-nfs-version 3"

Related branches

Revision history for this message
Christian Reis (kiko) wrote :
Revision history for this message
Christian Reis (kiko) wrote :

Actually, I am thinking that the right fix is to remove the check and the "--no-nfs-version 3" item completely, because:

  - There is no similar check for nfs versions 2 or 4, so it's weirdly inconsistent
  - As bug 897644 shows, it won't be possible to fix it completely anyway
  - We don't know why we need to pass that option to rpc.mountd in the first place!

If this was to prevent a crasher caused by a client bug, I don't believe a modern linux client will crash if it attempts to mount an nfsv3 mount if rpc.nfsd isn't serving version 3.

Revision history for this message
Christian Reis (kiko) wrote :

And if the user wants to disable a specific version, he's more likely to think he should do all that configuration in /etc/default/nfs-kernel-version anyway.

One gotcha in that file is that multiple options need to be quoted; maybe a nice fix would be to quote the defaults in there, i.e.

     RPCMOUNTDOPTS="--manage-gids"
     RPCSVCGSSDOPTS=""
     RPCNFSDOPTS=""

So it's easier to tack something on. Other default files seem to do that.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nfs-utils - 1:1.2.8-6ubuntu1

---------------
nfs-utils (1:1.2.8-6ubuntu1) trusty; urgency=medium

  * Merge from Debian unstable, remaining changes:
    - debian/nfs-common.{statd,statd-mounting,gssd,idmapd}.upstart,
      debian/control, debian/nfs-common.{preinst,postinst,prerm,postrm},
      debian/rules: drop nfs-common init script in favor of upstart jobs.
    - Depend on rpcbind (>= 0.2.0-6ubuntu1) for upstart support.
    - Depend on mountall (>= 2.41) to avoid deadlocks on boot.
    - debian/nfs-common.default: always start idmapd automatically; drop
      the configuration option.
    - nfs-kernel-server.init: Unmount nfsd fs when init script stops
    - Allow issuing options to rpc.nfsd
    - Add "-e" (ticket expiry is error) option to rpc.gssd to prevent hangs
      due to EKEYEXPIRED error from kernel on ticket expiry.

nfs-utils (1:1.2.8-6) unstable; urgency=medium

  * Fix the sec=krb5* handling in debian/nfs-common.init to properly match
    all cases. Closes: #715478.
  * Move the rpc.svcgssd(8) symlink to nfs-common along with the rest of it,
    and add the Replaces: on old versions of nfs-kernel-server to support
    upgrades properly. Closes: #731479.
  * Only start nfs-common in runlevel S; it doesn't need to be started
    more than once (and startpar won't actually run it more than once,
    anyway). Closes: #510528.
  * Fix obsolete invocations of update-rc.d by switching nfs-common to use
    dh_installinit. Closes: #736059.
  * Tweak nfs-common preinst to not remove nfs state files except on package
    removal (i.e., these should not be removed when the package is
    deconfigured temporarily).
  * debian/nfs-kernel-server.init: don't try to check for nfsv3 configuration
    in nfsd and pass --no-nfs-version 3 to mountd if absent; the check is
    buggy and impossible to make reliable, and there's no reason to single
    out NFSv3 here (and the original rationale for this behavior is lost).
    Closes LP: #897644, LP: #1284210.
  * Provide quoted entries by default in debian/nfs-kernel-server.default,
    consistent with other default files, so that users who edit the file to
    add multiple options don't accidentally cause shell syntax bugs.
 -- Steve Langasek <email address hidden> Tue, 25 Feb 2014 09:18:47 -0800

Changed in nfs-utils (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.