From ae63d7e8324c00771d1e754fb0c9304529c7cff3 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 a8b6317309..b58728ef4c 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.39.2