From 2831759869bed6e25a9a2f7dda67e9e8b844858a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Feb 2020 16:33:07 +0100 Subject: [PATCH] 2.35.1-3: fix fstrim.service --- ...e-Protect-setting-in-systemd-service.patch | 34 +++++++++++++++++++ util-linux.spec | 7 +++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0002-fstrim-do-not-use-Protect-setting-in-systemd-service.patch diff --git a/0002-fstrim-do-not-use-Protect-setting-in-systemd-service.patch b/0002-fstrim-do-not-use-Protect-setting-in-systemd-service.patch new file mode 100644 index 0000000..5ba1d2b --- /dev/null +++ b/0002-fstrim-do-not-use-Protect-setting-in-systemd-service.patch @@ -0,0 +1,34 @@ +From 61b384b36105fe682ddf16b9379f446d935603bc Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 4 Feb 2020 16:17:42 +0100 +Subject: [PATCH] fstrim: do not use Protect setting in systemd service + +The ProtectHome= and ProtectSystem= settings mounts all stuff for the service in read-only mode. + +The fstrim ioctl operates on read-only mountpoint file descriptor, but +on some read-only filesystem the operation can fail, so since +2d22ac64e4 we check for read-only volumes and skip it. + +References: Upstream: http://github.com/karelzak/util-linux/commit/2d22ac64e4d6e6732640f38b7232b5bcdc84a877 +Addresses: https://github.com/karelzak/util-linux/issues/948 +Signed-off-by: Karel Zak +--- + sys-utils/fstrim.service.in | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/sys-utils/fstrim.service.in b/sys-utils/fstrim.service.in +index a8b631730..b58728ef4 100644 +--- a/sys-utils/fstrim.service.in ++++ b/sys-utils/fstrim.service.in +@@ -6,8 +6,6 @@ ConditionVirtualization=!container + [Service] + Type=oneshot + ExecStart=@sbindir@/fstrim --fstab --verbose --quiet +-ProtectSystem=strict +-ProtectHome=read-only + PrivateDevices=no + PrivateNetwork=yes + PrivateUsers=no +-- +2.24.1 + diff --git a/util-linux.spec b/util-linux.spec index 0d44777..2e29cac 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.35.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: http://en.wikipedia.org/wiki/Util-linux @@ -109,6 +109,8 @@ Requires: libfdisk = %{version}-%{release} Patch0: 2.28-login-lastlog-create.patch # https://github.com/karelzak/util-linux/issues/949 Patch1: 0001-libfdisk-script-accept-sector-size-ignore-unknown-he.patch +# https://github.com/karelzak/util-linux/issues/948 +Patch2: 0002-fstrim-do-not-use-Protect-setting-in-systemd-service.patch %description The util-linux package contains a large variety of low-level system @@ -930,6 +932,9 @@ fi %{_libdir}/python*/site-packages/libmount/ %changelog +* Tue Feb 04 2020 Karel Zak - 2.35.1-3 +- fix fstrim.service (util-linux github #948) + * Tue Feb 04 2020 Karel Zak - 2.35.1-2 - fix sfdisk dump issue (util-linux github #949)