Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1233067 - autofs is performing excessive direct mount map re-reads
autofs is performing excessive direct mount map re-reads
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs (Show other bugs)
7.1
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Ian Kent
Yongcheng Yang
:
Depends On: 1232074
Blocks:
  Show dependency treegraph
 
Reported: 2015-06-18 03:36 EDT by Ian Kent
Modified: 2015-11-19 08:01 EST (History)
3 users (show)

See Also:
Fixed In Version: autofs-5.0.7-51.el7
Doc Type: Bug Fix
Doc Text:
Cause: When re-reading a direct mount map the stale map flag was not being correctly re-reset. Consequence: A direct map re-read is triggered on each map lookup. Fix: Correctly reset the map stale flag in all the places that need it. Result: Direct map re-reads are only done when request by a service reload.
Story Points: ---
Clone Of: 1232074
Environment:
Last Closed: 2015-11-19 08:01:02 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch - fix direct mount stale instance flag reset (999 bytes, patch)
2015-06-23 00:26 EDT, Ian Kent
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:2417 normal SHIPPED_LIVE Moderate: autofs security, bug fix and enhancement update 2015-11-19 06:23:21 EST

  None (edit)
Description Ian Kent 2015-06-18 03:36:16 EDT
+++ This bug was initially created as a clone of Bug #1232074 +++

Description of problem:
When re-reading a direct map the stale map instance flag is not being
reset. This causes the map to be seen as stale on subsequent lookups
thereby triggering a map re-read.


Version-Release number of selected component (if applicable):
autofs.x86_64 1:5.0.5-109.el6

This problem was seen when working on bug 1227496 so a subset
of the steps to reproduce the bug of 1227496 can be used to
reproduce it.

Steps to Reproduce:
1. Set autofs to produce debug log output to syslog.

# grep debug /etc/autofs.conf
# logging - set default log level "none", "verbose" or "debug"
logging = debug

and ensure rsyslog is logging facility daemon output

# grep daemon /etc/rsyslog.conf
daemon.*		/var/log/debug

2. Add a direct mount map to auto.master.

# grep direct /etc/auto.master
/- /etc/auto.direct

3. Add a couple of entries to the direct mount map but leave
   them commented out.
# cat /etc/auto.direct 
#/test/s1	bilbo:/Public
#/test/s2	bilbo:/autofs

4. Start the autofs service

# service autofs start

4. Modify /etc/auto.direct and uncomment the entries

# cat /etc/auto.direct 
/test/s1	bilbo:/Public
/test/s2	bilbo:/autofs

5. Reload the autofs maps

# service autofs reload

6. Access one of the direct mount map entries causing it
   to be mounted.

# ls /test/s1

7. Observe that in autofs debug logging shows a map re-read has
   been triggered after the lookup even though the maps has just
   been re-read by the re-load in step 4.
 
Actual results:
autofs re-reads the direct map on every mount lookup.

Expected results:
autofs doesn't re-read the direct map on lookup, only on re-load
requests.

--- Additional comment from Ian Kent on 2015-06-15 22:47:05 EDT ---

Patch is against upstream, needs back porting.
Comment 1 Ian Kent 2015-06-23 00:26:51 EDT
Created attachment 1042095 [details]
Patch - fix direct mount stale instance flag reset
Comment 3 XuWang 2015-08-28 08:39:09 EDT
run test case /autofs/sanity/reload for autofs-5.0.7-53.el7, seems good.

autofs previous version:
:: [  BEGIN   ] :: Running 'tests/readmap.sh'
posix          	on
Redirecting to /bin/systemctl stop  autofs.service
Redirecting to /bin/systemctl restart  autofs.service
Redirecting to /bin/systemctl reload  autofs.service
:: [  BEGIN   ] :: Running 'check_dir /direct/plus'
:: [   PASS   ] :: Command 'check_dir /direct/plus' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'check_dir /direct/plus2'
:: [   FAIL   ] :: Command 'check_dir /direct/plus2' (Expected 1, got 0)
Redirecting to /bin/systemctl stop  autofs.service
:: [   PASS   ] :: Command 'tests/readmap.sh' (Expected 0, got 0)


autofs-5.0.7-53.el7:
[04:22:32 root@ ~~]# tests/readmap.sh
posix          	on
Redirecting to /bin/systemctl stop  autofs.service
Redirecting to /bin/systemctl restart  autofs.service
Redirecting to /bin/systemctl reload  autofs.service
:: [  BEGIN   ] :: Running 'check_dir /direct/plus'
:: [   PASS   ] :: Command 'check_dir /direct/plus' (Expected 0, got 0)
:: [  BEGIN   ] :: Running 'check_dir /direct/plus2'
:: [   PASS   ] :: Command 'check_dir /direct/plus2' (Expected 1, got 1)
Redirecting to /bin/systemctl stop  autofs.service


also run regression, connectathon, stress, bugzillas test cases for autofs-5.0.7-53.el7, covers x86_64, s390x, ppc64, ppc64le, no new issues.

so I will change this bug status to be verified.
Comment 5 errata-xmlrpc 2015-11-19 08:01:02 EST
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, 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://rhn.redhat.com/errata/RHSA-2015-2417.html

Note You need to log in before you can comment on or make changes to this bug.