Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1961523

Summary: autofs: amd map hosts mount failing
Product: Red Hat Enterprise Linux 8 Reporter: Ian Kent <ikent>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED DUPLICATE QA Contact: Kun Wang <kunwan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: xzhou
Target Milestone: betaKeywords: Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-19 00:59:25 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:

Description Ian Kent 2021-05-18 07:39:18 UTC
Description of problem:
As a result of the changes for bug 1912106 I have found a couple more regressions, this is the last one I'm aware of.

This is due to an amd mounted mount entry not being added for certain hosts of an amd hosts mount.

Version-Release number of selected component (if applicable):
autofs-5.1.4-68.el8

How reproducible:
Always for certain amd hosts mount type maps.

Steps to Reproduce:
Steps to Reproduce:
1. Setup an NFS server with out of order exports.

Note: the server name I use below is f28 and it is define
in /etc/hosts with an FQDN of f28.long.domain.name.themaw.net.

mkdir /autofs
mkdir /exports
mkdir /exports/data/tmp
mkdir /exports/data/lib

Create /etc/exports as:
/autofs         *(rw,sync,no_subtree_check)
/exports                *(insecure,rw,sync,no_subtree_check)
/exports/data/tmp       *(insecure,rw,sync,no_subtree_check)
/exports/data/lib       *(insecure,rw,sync,no_subtree_check)

Check order of exports returned:
showmount -e
Export list for f28:
/exports/data/lib *
/exports/data/tmp *
/exports          *
/autofs           *

2. Add an amd entry to /etc/auto.master
/test/redhat    file,amd:/etc/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!=...

3. Start autofs and try to mount /test/redhat/exports/f28/exports/data/tmp     
   and observe that the offset (and the NFS mount) for export /exports/data/tmp
   has not been mounted:
service autofs start
ls /test/redhat/exports/f28/exports/data/tmp
ls: cannot access '/test/redhat/exports/f28/exports/data/tmp': No such file or directory
cat /proc/mounts|grep \/exports\/data\tmp

4. stop autofs and observe that shutdown has not succeeded
   cleanly, as it should in this case.
service stop autofs
cat /proc/mounts|grep \/test\/redhat
/etc/amd.redhat /test/redhat autofs rw,relatime,fd=-1,pgrp=23146,timeout=60,minproto=5,maxproto=5,indirect,pipe_ino=-1 0 0
/etc/amd.redhat /test/redhat/exports autofs rw,relatime,fd=-1,pgrp=23146,timeout=60,minproto=5,maxproto=5,indirect,pipe_ino=-1 0 0
/etc/amd.redhat /test/redhat/exports/f28.long.domain.name.themaw.net/exports autofs rw,relatime,fd=21,pgrp=23146,timeout=60,minproto=5,maxproto=5,offset,pipe_ino=129608 0 0

5. Cleanup
umount /test/redhat/exports/f28.long.domain.name.themaw.net/exports /test/redhat/exports /test/redhat

Actual results:
The mount above fails and following the mount attempt autofs is not able to shutdown cleanly.

Expected results:
The mount succeeds and autofs is able to shutdown cleanly.