Bug 1651257 - access to automounted dir with expiration time set can hang
Summary: access to automounted dir with expiration time set can hang
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: systemd
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: ---
Assignee: David Tardon
QA Contact: Frantisek Sumsal
Depends On:
TreeView+ depends on / blocked
Reported: 2018-11-19 14:41 UTC by David Tardon
Modified: 2019-08-06 12:43 UTC (History)
4 users (show)

Fixed In Version: systemd-219-64.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-08-06 12:43:36 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1572543 unspecified CLOSED [FJ7.5 Bug]: [REG] systemd: df hangs on rescue mode after updating from RHEL7.0 to RHEL7.5. 2020-10-14 00:28:05 UTC
Red Hat Bugzilla 1596241 urgent CLOSED yum update from RHEL7.3 to RHEL7.5 through RHSM hangs at " Updating : ksh-20120801-137.el7.x86_64 " indefinitely 2020-10-14 00:28:05 UTC
Red Hat Product Errata RHSA-2019:2091 None None None 2019-08-06 12:43:55 UTC

Internal Links: 1572543 1596241

Description David Tardon 2018-11-19 14:41:10 UTC
Description of problem:
If an expiration time is set for an automount unit, an access to the automounted dir after it expired will hang if 'systemd daemon-reload' was run meanwhile.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
# Setup
1. mkdir /etc/systemd/system/proc-sys-fs-binfmt_misc.automount.d
2. echo -e "[Automount]\nTimeoutIdleSec=5s" > /etc/systemd/system/proc-sys-fs-binfmt_misc.automount.d/timeout.conf # set up expiration time
3. systemctl daemon-reload # load the new config
4. systemctl restart proc-sys-fs-binfmt_misc.automount # optional, just to be sure
5. ls /proc/sys/fs/binfmt_misc # trigger the automount
6. sleep 5 # now let it expire
7. systemctl daemon-reload # trigger the bug
8. ls /proc/sys/fs/binfmt_misc # hang

Actual results:
ls hangs.

Expected results:
ls shows the content of the dir.

Additional info:
This is a regression in systemd-219-59 (7.5), caused by patch 0561-automount-if-an-automount-unit-is-masked-don-t-react.patch .

The bug can manifest itself during update from 7.3 to 7.5/7.6 (but not from 7.4 to 7.5), because systemd-219-30 in 7.3 hardcodes expiration timeout to 5min (expiration is disabled by default from 7.4 up). However, systemd-219-30 doesn't actually handle expiration. That was only fixed in systemd-219-42 in 7.4. And there is a lot of daemon-reloads run during the update.

Comment 2 David Tardon 2018-11-19 15:34:18 UTC

Comment 3 kevin 2018-11-21 02:37:30 UTC
what about 7.2? my issue happened in 7.2 with 'systemd-219-19.el7.x86_64' installed. I also did the steps to reproduce, but it didnt work on 7.2.

additional info:
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)


Comment 4 David Tardon 2018-11-21 08:59:10 UTC
(In reply to kevin from comment #3)
> hello, 
> what about 7.2? my issue happened in 7.2 with 'systemd-219-19.el7.x86_64'
> installed. I also did the steps to reproduce, but it didnt work on 7.2.

systemd didn't even handle automount expiration before 7.4. And the patch that causes this bug was added in 7.5. So whatever problem you have, it's something different than this.

Comment 6 Lukáš Nykrýn 2019-02-11 09:43:25 UTC
fix merged to staging branch -> https://github.com/lnykryn/systemd-rhel/pull/243 -> post

Comment 10 errata-xmlrpc 2019-08-06 12:43:36 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, and where to find the updated
files, follow the link below.

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


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