A System and Service Manager
CentOS Sources
2018-09-25 d16f065f4d1b0ada6348022ea66e6d865ac221db
import systemd-219-57.el7_5.3
1 files added
1 files modified
70 ■■■■■ changed files
SOURCES/0617-automount-handle-state-changes-of-the-corresponding-.patch 58 ●●●●● patch | view | raw | blame | history
SPECS/systemd.spec 12 ●●●●● patch | view | raw | blame | history
SOURCES/0617-automount-handle-state-changes-of-the-corresponding-.patch
New file
@@ -0,0 +1,58 @@
From 6869506c0f4e34163af53decdc08585c25be57ce Mon Sep 17 00:00:00 2001
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Fri, 24 Jul 2015 22:25:28 +0200
Subject: [PATCH] automount: handle state changes of the corresponding mount
 unit correctly
The expire timeout must be started/stopped if the corresponding mount unit
changes its state, e.g. it is started via local-fs.target or stopped by a
manual umount.
(cherry picked from commit 3dbadf9ef96e76f1bc472660ba5435dc0fa27a66)
Resolves: #1596241
---
 src/core/automount.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/core/automount.c b/src/core/automount.c
index 679fe071e..9046caba3 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -499,6 +499,7 @@ static int automount_send_ready(Automount *a, Set *tokens, int status) {
 int automount_update_mount(Automount *a, MountState old_state, MountState state) {
         _cleanup_close_ int ioctl_fd = -1;
+        int r;
         assert(a);
@@ -506,6 +507,9 @@ int automount_update_mount(Automount *a, MountState old_state, MountState state)
         case MOUNT_MOUNTED:
         case MOUNT_REMOUNTING:
                 automount_send_ready(a, a->tokens, 0);
+                r = automount_start_expire(a);
+                if (r < 0)
+                        log_unit_warning_errno(UNIT(a)->id, r, "Failed to start expiration timer, ignoring: %m");
                 break;
          case MOUNT_DEAD:
          case MOUNT_UNMOUNTING:
@@ -518,6 +522,7 @@ int automount_update_mount(Automount *a, MountState old_state, MountState state)
          case MOUNT_FAILED:
                 if (old_state != state)
                         automount_send_ready(a, a->tokens, -ENODEV);
+                (void) sd_event_source_set_enabled(a->expire_event_source, SD_EVENT_OFF);
                 break;
         default:
                 break;
@@ -768,10 +773,6 @@ static void automount_enter_running(Automount *a) {
                 goto fail;
         }
-        r = automount_start_expire(a);
-        if (r < 0)
-                log_unit_warning_errno(UNIT(a)->id, r, "Failed to start expiration timer, ignoring: %m");
-
         automount_set_state(a, AUTOMOUNT_RUNNING);
         return;
SPECS/systemd.spec
@@ -7,7 +7,7 @@
Name:           systemd
Url:            http://www.freedesktop.org/wiki/Software/systemd
Version:        219
Release:        57%{?dist}.1
Release:        57%{?dist}.3
# For a breakdown of the licensing, see README
License:        LGPLv2+ and MIT and GPLv2+
Summary:        A System and Service Manager
@@ -655,6 +655,7 @@
Patch0614: 0614-umount-always-use-MNT_FORCE-in-umount_all-7213.patch
Patch0615: 0615-core-Implement-timeout-based-umount-remount-limit.patch
Patch0616: 0616-core-Implement-sync_with_progress.patch
Patch0617: 0617-automount-handle-state-changes-of-the-corresponding-.patch
%global num_patches %{lua: c=0; for i,p in ipairs(patches) do c=c+1; end; print(c);}
@@ -1052,6 +1053,9 @@
systemd-machine-id-setup >/dev/null 2>&1 || :
/usr/lib/systemd/systemd-random-seed save >/dev/null 2>&1 || :
systemctl daemon-reexec >/dev/null 2>&1 || :
for u in `systemctl show -p Id --state=active \*.automount | cut -d = -f 2`; do
    systemctl try-restart $u >/dev/null 2>&1 || :
done
systemctl start systemd-udevd.service >/dev/null 2>&1 || :
udevadm hwdb --update >/dev/null 2>&1 || :
journalctl --update-catalog >/dev/null 2>&1 || :
@@ -1628,6 +1632,12 @@
%{_mandir}/man8/systemd-resolved.*
%changelog
* Fri Aug 31 2018 Lukas Nykryn <lnykryn@redhat.com> - 219-57.3
- restart automounts unit on update (#1596241)
* Mon Jul 30 2018 Lukas Nykryn <lnykryn@redhat.com> - 219-57.2
- automount: handle state changes of the corresponding mount unit correctly (#1596241)
* Mon Jun 25 2018 Lukas Nykryn <lnykryn@redhat.com> - 219-57.1
- umount: always use MNT_FORCE in umount_all() (#7213) (#1571098)
- core: Implement timeout based umount/remount limit (#1571098)