Bug 1958485

Summary: autofs amd type host mounts fail for certain host names
Product: Red Hat Enterprise Linux 8 Reporter: Ian Kent <ikent>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: Kun Wang <kunwan>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.4CC: xzhou, zlang
Target Milestone: betaKeywords: Regression, Triaged
Target Release: 8.5Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: autofs-5.1.4-68.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1958486 (view as bug list) Environment:
Last Closed: 2021-11-09 19:32:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1958486    
Attachments:
Description Flags
Patch - fix amd hosts mount expire none

Description Ian Kent 2021-05-08 07:30:38 UTC
Description of problem:
autofs amd mounts that are present in the autofs configuration, rather than in the master map itself, are umounted when the automount configuration is reloaded.

Not sure when this started happening. 

How reproducible:
always.


Steps to Reproduce:
1. Add an amd entry to /etc/autofs.conf
   eg., at the bottom of /etc/autofs.conf add:

[ /test/redhat ]
# map name must be defined, all else are optional
map_name = amd.redhat

Where /etc/amd.redhat contains, say:
exports   fs:=${map};pref:=${key}
exports/* hostd==${/key}.long.domain.name.themaw.net;type:=link;fs:=/ \
          hostd!=${/key}.long.domain.name.themaw.net; \
            type:=host; rhost:=${/key}.long.domain.name.themaw.net;\
            opts:=rw,hard,intr,nosuid,retrans=9,timeo=45;\
            fs:=${autodir}/redhat/${key}

You might need to get rid of the line continueations following the
hostd!=...
2. Setup an nfs server, the one here is f28.long.domain.name.themaw.net
   and export some paths, for example /raven, /exports, etc.
3. Start NFS on the server and ensure clients an mount its exports.
4  Now, on the client start autofs and try and access one of the exports
   with:
   ls /test/redhat/exports/f28/exports/raven

Actual results:
The export fails to mount.

Expected results:
The export mounts and is accessable.

Additional info:
This is the same failure I have been seeing in the CI test amd-basic,
the last test always failing.

I had been unable to reproduce it and running the test manually on
beaker would always succeed which I couldn't understand since the 
tests themselves look fine.

Hopefully this will resolve my CI problem at last.

Comment 1 Ian Kent 2021-05-08 07:36:22 UTC
(In reply to Ian Kent from comment #0)
> Description of problem:
> autofs amd mounts that are present in the autofs configuration, rather than
> in the master map itself, are umounted when the automount configuration is
> reloaded.

The reproducer actually describes and mount type host failing for an unknown
reason.

It seems to be longer host names that are a problem.

Comment 2 Ian Kent 2021-05-08 07:46:56 UTC
(In reply to Ian Kent from comment #0)
> 
> Steps to Reproduce:
> 1. Add an amd entry to /etc/autofs.conf
>    eg., at the bottom of /etc/autofs.conf add:
> 
> [ /test/redhat ]
> # map name must be defined, all else are optional
> map_name = amd.redhat
> 
> Where /etc/amd.redhat contains, say:
> exports   fs:=${map};pref:=${key}
> exports/* hostd==${/key}.long.domain.name.themaw.net;type:=link;fs:=/ \
>           hostd!=${/key}.long.domain.name.themaw.net; \
>             type:=host; rhost:=${/key}.long.domain.name.themaw.net;\
>             opts:=rw,hard,intr,nosuid,retrans=9,timeo=45;\
>             fs:=${autodir}/redhat/${key}
> 
> You might need to get rid of the line continueations following the
> hostd!=...
> 2. Setup an nfs server, the one here is f28.long.domain.name.themaw.net
>    and export some paths, for example /raven, /exports, etc.
> 3. Start NFS on the server and ensure clients an mount its exports.
> 4  Now, on the client start autofs and try and access one of the exports
>    with:
>    ls /test/redhat/exports/f28/exports/raven
> 
> Actual results:
> The export fails to mount.
> 
> Expected results:
> The export mounts and is accessable.
> 
> Additional info:
> This is the same failure I have been seeing in the CI test amd-basic,
> the last test always failing.
> 
> I had been unable to reproduce it and running the test manually on
> beaker would always succeed which I couldn't understand since the 
> tests themselves look fine.
> 
> Hopefully this will resolve my CI problem at last.

You might be able to reproduce this with the amd-basic Beaker test
but as I say it always worked when I ran it manually.

Comment 3 Ian Kent 2021-05-10 00:30:51 UTC
Created attachment 1781461 [details]
Patch - fix amd hosts mount expire

Comment 6 Ian Kent 2021-05-19 00:59:25 UTC
*** Bug 1961523 has been marked as a duplicate of this bug. ***

Comment 11 errata-xmlrpc 2021-11-09 19:32:44 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (autofs bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4372