Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 827239 - net-fs/autofs-5.1.8 hangs and fails on nfs4 mount
Summary: net-fs/autofs-5.1.8 hangs and fails on nfs4 mount
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Yixun Lan
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-25 06:56 UTC by Enne Eziarc
Modified: 2021-12-22 13:18 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
autofs 5.1.7 debug output (autofs-5.1.7.txt,2.68 KB, text/plain)
2021-11-25 06:56 UTC, Enne Eziarc
Details
autofs 5.1.8 debug output (autofs-5.1.8.txt,2.21 KB, text/plain)
2021-11-25 06:57 UTC, Enne Eziarc
Details
patch to revert the commit that introduced the problem (27fc1510b33a2017c84679950d579b04c3d70d72.patch,1.05 KB, patch)
2021-11-30 08:01 UTC, foufou33
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Enne Eziarc 2021-11-25 06:56:58 UTC
Created attachment 756160 [details]
autofs 5.1.7 debug output

I'm running an NFSv4-only server with autofs on the client: after upgrading from 5.1.7-r1 to autofs-5.1.8 it can no longer mount shares. Attached below are log files of the output of `automount --foreground --debug` for both versions.

5.1.8 seems to be trying NFSv3 despite everything in my config files telling it to use NFSv4; the changelog mentions "refactor get_nfs_info()" which may have caused all this, and that's the part where it times out in the log. If I try to placate it by running rpcbind on the server side, the "get_portmap_client: error 0x3 getting portmap client" lines go away but it otherwise fails the same.

I couldn't find an upstream to report bugs to, sorry - the ebuild HOMEPAGE points to web.archive.org and search engines only give me a dead mailing list and a webserver directory of tarballs.
Comment 1 Enne Eziarc 2021-11-25 06:57:24 UTC
Created attachment 756163 [details]
autofs 5.1.8 debug output
Comment 2 Yixun Lan archtester gentoo-dev 2021-11-25 09:16:42 UTC
sounds a bug which introduced at 5.1.8..

I did a basic test here, which kinds of working fine..

could you paste your /etc/autofs/nfs configuration file?
as I see you are using "noatime,proto=tcp6,timeo=20,vers=4.2"? can you try 'proto=tcp'? not sure if it fail to recognize this option
Comment 3 foufou33 2021-11-30 07:43:10 UTC
it ssem to be trying to contact the host on port 111, if the ports are blocked (as in in our case, some servers do bloque these are there are unsed for nfs4)  it fails miserably
Comment 4 foufou33 2021-11-30 07:54:50 UTC
the commit that introdueced it 
https://git.kernel.org/pub/scm/linux/storage/autofs/autofs.git/commit/CHANGELOG?id=606795ecfaa1ba45ab58fa20376213f6089e42e9
does look like a "feature"
Comment 5 foufou33 2021-11-30 08:01:12 UTC
Created attachment 757040 [details, diff]
patch to revert the commit that introduced the problem

drop in /etc/portage/patches if you want
Comment 6 Enne Eziarc 2021-12-09 19:15:06 UTC
(In reply to Yixun Lan from comment #2)
> sounds a bug which introduced at 5.1.8..
> 
> I did a basic test here, which kinds of working fine..
> 
> could you paste your /etc/autofs/nfs configuration file?
> as I see you are using "noatime,proto=tcp6,timeo=20,vers=4.2"? can you try
> 'proto=tcp'? not sure if it fail to recognize this option

sorry for late response. Here's everything that may be relevant, I've toned down the mount options here (proto=tcp,vers=4) and still get the hang with any combination however:

========
# rg -Nv '^($|#)' /etc/autofs/{autofs.conf,auto.master,nfs}
/etc/autofs/autofs.conf
[ autofs ]
timeout = 300
negative_timeout = 10
browse_mode = no
mount_nfs_default_protocol = 4
[ amd ]
dismount_interval = 0

/etc/autofs/auto.master
/mnt/nfs    /etc/autofs/nfs     browse,noatime,proto=tcp,timeo=20,vers=4

/etc/autofs/nfs
firmware     -ro rynex:/lib/firmware/
home             rynex:/home/
local        -ro rynex:/usr/local/
portage          rynex:/srv/portage/
src          -ro rynex:/usr/src/
www              rynex:/srv/www/
========

Out of curiosity I went browsing through the source code to see how this stuff works and found something in there about setting fstype=nfs4 overriding the faulty autodetection, but trying it everywhere in the config files had no effect.



(In reply to foufou33 from comment #5)
> Created attachment 757040 [details, diff] [details, diff]
> patch to revert the commit that introduced the problem
> 
> drop in /etc/portage/patches if you want

That works for me, and looks arguably more correct. Thanks!
Comment 7 Larry the Git Cow gentoo-dev 2021-12-22 13:18:13 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7586f437afc004fee03a1fdf586d6dd9b7db480

commit f7586f437afc004fee03a1fdf586d6dd9b7db480
Author:     Yixun Lan <dlan@gentoo.org>
AuthorDate: 2021-12-22 13:15:58 +0000
Commit:     Yixun Lan <dlan@gentoo.org>
CommitDate: 2021-12-22 13:17:52 +0000

    net-fs/autofs: fix nfsv4 mount issue
    
    Closes: https://bugs.gentoo.org/827239
    Package-Manager: Portage-3.0.28, Repoman-3.0.3
    Signed-off-by: Yixun Lan <dlan@gentoo.org>

 ...{autofs-5.1.8.ebuild => autofs-5.1.8-r1.ebuild} |  1 +
 net-fs/autofs/files/autofs-5.1.8-nfsv4-mount.patch | 88 ++++++++++++++++++++++
 2 files changed, 89 insertions(+)