From d16f065f4d1b0ada6348022ea66e6d865ac221db Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 25 2018 17:34:09 +0000 Subject: import systemd-219-57.el7_5.3 --- diff --git a/SOURCES/0617-automount-handle-state-changes-of-the-corresponding-.patch b/SOURCES/0617-automount-handle-state-changes-of-the-corresponding-.patch new file mode 100644 index 0000000..feb9a67 --- /dev/null +++ b/SOURCES/0617-automount-handle-state-changes-of-the-corresponding-.patch @@ -0,0 +1,58 @@ +From 6869506c0f4e34163af53decdc08585c25be57ce Mon Sep 17 00:00:00 2001 +From: Michael Olbrich +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; + diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 6a7ae36..49247cf 100644 --- a/SPECS/systemd.spec +++ b/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 @@ Patch0613: 0613-sd-journal-when-picking-up-a-new-file-compare-inode-.patch 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 @@ systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd- 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 @@ fi %{_mandir}/man8/systemd-resolved.* %changelog +* Fri Aug 31 2018 Lukas Nykryn - 219-57.3 +- restart automounts unit on update (#1596241) + +* Mon Jul 30 2018 Lukas Nykryn - 219-57.2 +- automount: handle state changes of the corresponding mount unit correctly (#1596241) + * Mon Jun 25 2018 Lukas Nykryn - 219-57.1 - umount: always use MNT_FORCE in umount_all() (#7213) (#1571098) - core: Implement timeout based umount/remount limit (#1571098)