[Bug 1818121] Re: NFSv4 shares with option `-vers=4.0` are not mounted: mount(nfs): no hosts available

Paul Menzel 1818121 at bugs.launchpad.net
Mon Mar 4 15:38:36 UTC 2019


Thank you for trying to reproduce the issue, and sorry for missing out
information. In this case, due to NFS 4.2 issues, we have specified the
exact NFS version.

     joey -vers=4.0 claptrap:/amd/claptrap/2/home/edv/joey

Bisecting the fix in autofs 5.1.4, results in the commit aa1f4321
(autofs-5.1.3 - handle additional nfs versions in mount_nfs.c).

commit aa1f432180f3878c303088def8d647f1bd50b10b (refs/bisect/fixed)
Author: Ian Kent <raven at themaw.net>
Date:   Thu Oct 19 08:48:44 2017 +0800

    autofs-5.1.3 - handle additional nfs versions in mount_nfs.c

    Since NFSv4 can now have a subversion it needs to be allowed for.

    It's enough to check for an options string starting with "vers=4" or
    "nfsvers=4" because it's used only to set a flag used for special
    casing the availibility probe for any NFS version 4 version.

    Signed-off-by: Ian Kent <raven at themaw.net>

diff --git a/CHANGELOG b/CHANGELOG
index 2da2cdc..3a1e4a6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -35,6 +35,7 @@ xx/xx/2017 autofs-5.1.4
 - make map source reference message debug only.
 - improve description of mount_nfs_default_protocol.
 - the port option should not behave like nobind option.
+- handle additional nfs versions in mount_nfs.c.

 24/05/2017 autofs-5.1.3
 =======================
diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
index 5245d96..d3ebd92 100644
--- a/modules/mount_nfs.c
+++ b/modules/mount_nfs.c
@@ -147,8 +147,9 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
                        } else if (_strncmp("use-weight-only", cp, o_len) == 0) {
                                flags |= MOUNT_FLAG_USE_WEIGHT_ONLY;
                        } else {
-                               if (_strncmp("vers=4", cp, o_len) == 0 ||
-                                   _strncmp("nfsvers=4", cp, o_len) == 0)
+                               /* Is any version of NFSv4 in the options */
+                               if (_strncmp("vers=4", cp, 6) == 0 ||
+                                   _strncmp("nfsvers=4", cp, 9) == 0)
                                        vers = NFS4_VERS_MASK | TCP_SUPPORTED;
                                else if (_strncmp("vers=3", cp, o_len) == 0 ||
                                         _strncmp("nfsvers=3", cp, o_len) == 0) {

Reading the commit message and looking at the change, it makes sense,
that this fixes the issue. Could you please apply this to the package?

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to autofs in Ubuntu.
https://bugs.launchpad.net/bugs/1818121

Title:
  NFSv4 shares with option `-vers=4.0` are not mounted: mount(nfs): no
  hosts available

Status in autofs package in Ubuntu:
  Incomplete

Bug description:
  With Ubuntu 18.10 and autofs 5.1.2-4ubuntu1, mounting NFSv4 shares
  does not work. Directly mounting them with `mount.nfs` works.

  ```
  Feb 28 18:08:30 nfsclient automount[22978]: expire_proc: exp_proc = 131147807650128 path /home_mariux
  Feb 28 18:08:30 nfsclient automount[22978]: expire_cleanup: got thid 131147807650128 path /home_mariux stat 0
  Feb 28 18:08:30 nfsclient automount[22978]: expire_cleanup: sigchld: exp 131147807650128 finished, switching from 2 to 1
  Feb 28 18:08:30 nfsclient automount[22978]: st_ready: st_ready(): state = 2 path /home_mariux
  Feb 28 18:08:32 nfsclient automount[22978]: handle_packet: type = 3
  Feb 28 18:08:32 nfsclient automount[22978]: handle_packet_missing_indirect: token 46, name joey, request pid 28647
  Feb 28 18:08:32 nfsclient automount[22978]: attempting to mount entry /home_mariux/joey
  Feb 28 18:08:32 nfsclient automount[22978]: lookup_mount: lookup(file): looking up joey
  Feb 28 18:08:32 nfsclient automount[22978]: lookup_mount: lookup(file): joey -> claptrap:/amd/claptrap/2/home/edv/joey
  Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): expanded entry: claptrap:/amd/claptrap/2/home/edv/joey
  Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): gathered options: nosuid
  Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): dequote("claptrap:/amd/claptrap/2/home/edv/joey") -> claptrap:/amd/claptrap/2/home/edv/bucz
  Feb 28 18:08:32 nfsclient automount[22978]: parse_mount: parse(sun): core of entry: options=nosuid, loc=claptrap:/amd/claptrap/2/home/edv/joey
  Feb 28 18:08:32 nfsclient automount[22978]: sun_mount: parse(sun): mounting root /home_mariux, mountpoint joey, what claptrap:/amd/claptrap/2/home/edv/joey, f
  Feb 28 18:08:32 nfsclient automount[22978]: mount_mount: mount(nfs): root=/home_mariux name=joey what=claptrap:/amd/claptrap/2/home/edv/joey, fstype=nfs, opti
  Feb 28 18:08:32 nfsclient automount[22978]: mount_mount: mount(nfs): nfs options="nosuid", nobind=0, nosymlink=0, ro=0
  Feb 28 18:08:32 nfsclient automount[22978]: get_nfs_info: called with host claptrap(141.14.16.132) proto 6 version 0x30
  Feb 28 18:08:32 nfsclient automount[22978]: get_nfs_info: called with host claptrap(141.14.16.132) proto 17 version 0x30
  Feb 28 18:08:32 nfsclient automount[22978]: mount(nfs): no hosts available
  Feb 28 18:08:32 nfsclient automount[22978]: dev_ioctl_send_fail: token = 46
  Feb 28 18:08:32 nfsclient automount[22978]: failed to mount /home_mariux/joey
  Feb 28 18:08:32 nfsclient automount[22978]: st_readmap: state 1 path /home_mariux
  Feb 28 18:08:32 nfsclient automount[22978]: handle_packet: type = 3
  Feb 28 18:08:32 nfsclient automount[22978]: handle_packet_missing_indirect: token 47, name joey, request pid 28647
  Feb 28 18:08:32 nfsclient automount[22978]: dev_ioctl_send_fail: token = 47
  Feb 28 18:08:32 nfsclient automount[22978]: re-reading map for /home_mariux
  Feb 28 18:08:32 nfsclient automount[22978]: lookup_nss_read_map: reading map file /etc/automount/auto.home
  Feb 28 18:08:32 nfsclient automount[22978]: do_init: parse(sun): init gathered global options: nosuid
  Feb 28 18:08:32 nfsclient automount[22978]: st_ready: st_ready(): state = 4 path /home_mariux
  ```

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1818121/+subscriptions



More information about the foundations-bugs mailing list