Bug 1961492

Summary: autofs: regression in offset ordering
Product: Red Hat Enterprise Linux 8 Reporter: Ian Kent <ikent>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED ERRATA QA Contact: Kun Wang <kunwan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.5CC: kunwan, xzhou
Target Milestone: betaKeywords: Regression, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: autofs-5.1.4-69.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1965870 (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: 1965870    
Attachments:
Description Flags
Patch - fix offset entries order
none
Patch - use mapent tree root for tree_mapent_add_node()
none
Patch - eliminate redundant cache lookup in tree_mapent_add_node()
none
Patch - fix hosts map offset order
none
Patch - fix direct mount deadlock none

Description Ian Kent 2021-05-18 06:13:15 UTC
Description of problem:

As a result of the changes for bug 1912106 I have found a couple more regressions, this is one.

This is due to exports offset mount ordering.

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


How reproducible:
Always under certain circumstances.

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. Ensure the /net entry in /etc/auto.master is uncommented:
/net    -hosts

3. Start autofs and trigger mount /net/f28/exports/data/tmp:
ls /net/f28/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 \/net
-hosts /net autofs rw,relatime,fd=-1,pgrp=21690,timeout=60,minproto=5,maxproto=5,indirect,pipe_ino=-1 0 0
-hosts /net/f28/exports autofs rw,relatime,fd=6,pgrp=21690,timeout=60,minproto=5,maxproto=5,offset,pipe_ino=130159 0 0

5. Cleanup
umount /net/f28/exports /net

Actual results:
Not all mounts can be umounted at shutdown when they should be in this case.


Expected results:
All mounts not in use at shutdown are umounted cleanly.

Comment 1 Ian Kent 2021-05-19 01:22:54 UTC
Created attachment 1784646 [details]
Patch - fix offset entries order

Comment 2 Ian Kent 2021-05-19 01:24:07 UTC
Created attachment 1784647 [details]
Patch - use mapent tree root for tree_mapent_add_node()

Comment 3 Ian Kent 2021-05-19 01:25:14 UTC
Created attachment 1784648 [details]
Patch - eliminate redundant cache lookup in tree_mapent_add_node()

Comment 4 Ian Kent 2021-05-19 01:26:31 UTC
Created attachment 1784649 [details]
Patch - fix hosts map offset order

Comment 5 Ian Kent 2021-05-19 01:27:42 UTC
Created attachment 1784650 [details]
Patch - fix direct mount deadlock

Comment 20 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