|
Bugzilla – Full Text Bug Listing |
| Summary: | fstrim attempts to auto trim partition without being told to and gives unclear feedback | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE Distribution | Reporter: | Deleted Name <deleted> |
| Component: | Other | Assignee: | Stanislav Brabec <sbrabec> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | jack, srid |
| Version: | Leap 15.0 | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | Other | ||
| Whiteboard: | ibs:running:12160:moderate ibs:running:12158:moderate ibs:running:12159:moderate | ||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
Deleted Name
2018-08-28 10:25:00 UTC
There is fstrim.timer to be executed once a week. Is that new in Leap 15.0? Happens with Leap 15.1 Beta. fstrim fails to trim my read-only windows partition (Why would it try to do it in first place?) TRIM once in a week is a default behavior. Attempting to TRIM read-only filesystems seems to be a bug in "fstrim -a" and/or "fstrim -A". Behavior of fstrim on read-only partitions is filesystem specific. For example, btrfs has no problem with trimming on read-only mount, as long as the device itself is R/W. But skipping R/O volumes is safe and logical behavior. I cannot reproduce your error. However the code apparently did not skip read-only file systems. Please test proposed fix together with bug 1127701. openSUSE Tumbleweed: Project: https://build.opensuse.org/project/show/home:sbrabec:branches:util-linux-fstrim-A-b1127701 Repo: https://download.opensuse.org/repositories/home:/sbrabec:/branches:/util-linux-fstrim-A-b1127701/openSUSE_Factory/home:sbrabec:branches:util-linux-fstrim-A-b1127701.repo openSUSE Leap 15.1: Project: https://build.opensuse.org/project/monitor/home:sbrabec:branches:util-linux-fstrim-A-b1127701-leap151 Repo: https://download.opensuse.org/repositories/home:/sbrabec:/branches:/util-linux-fstrim-A-b1127701-leap151/openSUSE_Leap_15.1_Update/home:sbrabec:branches:util-linux-fstrim-A-b1127701-leap151.repo According to the upstream, the bug is primarily problem of the NTFS driver. There are several related fixes in util-linux: fstrim: check for read-only devices on -a/-A https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=fe7d63105d923d43c9f478acded0ac888463e456 and introduces new option --quiet My fix proposes complete skipping of read-only devices in fstrim -a/-A. Sent to the upstream: bug 1127701: https://www.spinics.net/lists/util-linux-ng/msg15752.html bug 1127701: https://www.spinics.net/lists/util-linux-ng/msg15751.html https://www.spinics.net/lists/util-linux-ng/msg15753.html And accepted: bug 1127701: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=4080be3d7d84952e42048d2f266d49412ada955c bug 1127701: https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=402006fa6e4dd1ce52758f9be91caaffffb3f337 https://git.kernel.org/pub/scm/utils/util-linux/util-linux.git/commit/?id=2d22ac64e4d6e6732640f38b7232b5bcdc84a877 Note that my fix is different than the fe7d63105d923d43c9f478acded0ac888463e456 above: The first one checks for ro mount options, my one checks for writability of the target. My one can skip temporary read-only remounts. Iakov Karpov, comment 3: This behavior is intentional. Regular TRIM should increase performance of SSD discs by pre-erasing of unused blocks. It is safe for rotating devices, as the command is ignored there. (In reply to Stanislav Brabec from comment #7) > Iakov Karpov, comment 3: This behavior is intentional. Regular TRIM should > increase performance of SSD discs by pre-erasing of unused blocks. It is > safe for rotating devices, as the command is ignored there. I don't think that trimming blocks, claimed by read-only filesystem is a good idea. If someone explicitly mounts a filesystem as read-only, they probably want it to stay untouched. Iakov Karpov, comment 8: I agree. Trimming the read-only partition sounds wrong, and makes no sense. I assumed that your "Why would it try" refers to the trimming of the partition itself. Surprisingly, many kernel drivers have no problem with trimming of read-only mounts. To Jan Kára: Do you think that kernel should implement EROFS error when trying to FITRIM of read-only file system? So technically there's no problem with trimming read-only filesystem. I agree it may be somewhat unexpected that the kernel allows this but OTOH the filesystem as such does not change. We just tell underlying storage which blocks are free and which not, which makes sense for read-only filesystem as well and I can even see some uses for that (such as populating filesystem image, then remounting it read-only, then when block allocations are all stable we can fstrim to tell underlying storage about unused blocks). That being said I agree that "fstrim -a" periodically trimming read-only filesystems is probably just a waste of disk time so I think the most sensible solution would be for "fstrim -a" to just skip read-only filesystems. Proposal for the forthcoming online update of util-linux: Fix for: SLE15SP1 SLE15 SLE12SP5 SLE12SP4 SLE12SP3 SLE12SP2 Leap15.1 Leap15 Fixed by the version update for: Factory Ignore for: SLE12SP1 SLE12 If you want to change this proposal, please let me know. Note: For technical reasons (fstrim -A patch sequence), the patch will have different names in different updates: util-linux-fstrim-A-2.patch in SLE15SP1 SLE12SP5 Leap15.1 util-linux-fstrim-RO.patch in SLE15 SLE12SP4 SLE12SP3 SLE12SP2 Leap15 Fixed for: SLE15SP1 SLE15 Leap15.1 Leap15.0 SLE12SP5 SLE12SP4 SLE12SP3 SLE12SP2 Fixed out of the box for: Factory Ignored for: SLE12SP1 SLE12 SUSE-SU-2019:2307-1: An update that contains security fixes can now be installed. Category: security (moderate) Bug References: 1081947,1082293,1085196,1106214,1121197,1122417,1125886,1127701,1135534,1135708,1141113,353876 CVE References: Sources used: SUSE Linux Enterprise Module for Server Applications 15-SP1 (src): util-linux-systemd-2.33.1-4.5.1 SUSE Linux Enterprise Module for Open Buildservice Development Tools 15-SP1 (src): python3-libmount-2.33.1-4.5.1, util-linux-2.33.1-4.5.1 SUSE Linux Enterprise Module for Basesystem 15-SP1 (src): shadow-4.6-3.5.6, util-linux-2.33.1-4.5.1, util-linux-systemd-2.33.1-4.5.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. openSUSE-SU-2019:2121-1: An update that contains security fixes can now be installed. Category: security (moderate) Bug References: 1081947,1082293,1085196,1106214,1121197,1122417,1125886,1127701,1135534,1135708,1141113,353876 CVE References: Sources used: openSUSE Leap 15.1 (src): python3-libmount-2.33.1-lp151.3.3.2, shadow-4.6-lp151.2.3.2, util-linux-2.33.1-lp151.3.3.2, util-linux-systemd-2.33.1-lp151.3.3.2 The fix was just released. Closing. SUSE-SU-2019:2392-1: An update that contains security fixes can now be installed. Category: security (moderate) Bug References: 1081947,1082293,1085196,1106214,1121197,1122417,1125886,1135534,1135708,353876 CVE References: Sources used: SUSE Linux Enterprise Module for Server Applications 15 (src): util-linux-systemd-2.31.1-9.8.1 SUSE Linux Enterprise Module for Open Buildservice Development Tools 15-SP1 (src): python-libmount-2.31.1-9.8.1 SUSE Linux Enterprise Module for Open Buildservice Development Tools 15 (src): python-libmount-2.31.1-9.8.1, util-linux-2.31.1-9.8.1 SUSE Linux Enterprise Module for Basesystem 15 (src): shadow-4.5-7.6.4, util-linux-2.31.1-9.8.1, util-linux-systemd-2.31.1-9.8.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. openSUSE-SU-2019:2175-1: An update that contains security fixes can now be installed. Category: security (moderate) Bug References: 1081947,1082293,1085196,1106214,1121197,1122417,1125886,1135534,1135708,353876 CVE References: Sources used: openSUSE Leap 15.0 (src): shadow-4.5-lp150.11.2, util-linux-2.31.1-lp150.7.10.2 SUSE-SU-2021:3463-1: An update that solves one vulnerability and has 19 fixes is now available. Category: security (moderate) Bug References: 1081947,1082293,1084671,1085196,1106214,1122417,1125886,1135534,1135708,1151708,1168235,1168389,1169006,1174942,1175514,1175623,1178236,1178554,1178825,1188921 CVE References: CVE-2021-37600 JIRA References: Sources used: SUSE OpenStack Cloud Crowbar 8 (src): python-libmount-2.29.2-3.24.1, util-linux-2.29.2-3.24.1, util-linux-systemd-2.29.2-3.24.1 SUSE OpenStack Cloud 8 (src): python-libmount-2.29.2-3.24.1, util-linux-2.29.2-3.24.1, util-linux-systemd-2.29.2-3.24.1 SUSE Linux Enterprise Server for SAP 12-SP3 (src): python-libmount-2.29.2-3.24.1, util-linux-2.29.2-3.24.1, util-linux-systemd-2.29.2-3.24.1 SUSE Linux Enterprise Server 12-SP3-LTSS (src): python-libmount-2.29.2-3.24.1, util-linux-2.29.2-3.24.1, util-linux-systemd-2.29.2-3.24.1 SUSE Linux Enterprise Server 12-SP3-BCL (src): python-libmount-2.29.2-3.24.1, util-linux-2.29.2-3.24.1, util-linux-systemd-2.29.2-3.24.1 HPE Helion Openstack 8 (src): python-libmount-2.29.2-3.24.1, util-linux-2.29.2-3.24.1, util-linux-systemd-2.29.2-3.24.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. SUSE-SU-2022:1103-1: An update that solves one vulnerability and has 23 fixes is now available. Category: security (important) Bug References: 1038841,1081947,1082293,1084671,1085196,1106214,1116347,1122417,1125886,1135534,1135708,1151708,1168235,1168389,1169006,1172427,1174942,1175514,1175623,1178236,1178554,1178825,1188921,1194642 CVE References: CVE-2021-37600 JIRA References: Sources used: SUSE Linux Enterprise Server 12-SP2-BCL (src): python-libmount-2.28-44.35.1, util-linux-2.28-44.35.1, util-linux-systemd-2.28-44.35.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. SUSE-SU-2022:1105-1: An update that solves one vulnerability and has 21 fixes is now available. Category: security (important) Bug References: 1081947,1082293,1084671,1085196,1106214,1122417,1125886,1135534,1135708,1151708,1168235,1168389,1169006,1172427,1174942,1175514,1175623,1178236,1178554,1178825,1188921,1194642 CVE References: CVE-2021-37600 JIRA References: Sources used: SUSE OpenStack Cloud Crowbar 9 (src): python-libmount-2.29.2-9.17.1, util-linux-2.29.2-9.17.1, util-linux-systemd-2.29.2-9.17.1 SUSE OpenStack Cloud 9 (src): python-libmount-2.29.2-9.17.1, util-linux-2.29.2-9.17.1, util-linux-systemd-2.29.2-9.17.1 SUSE Linux Enterprise Server for SAP 12-SP4 (src): python-libmount-2.29.2-9.17.1, util-linux-2.29.2-9.17.1, util-linux-systemd-2.29.2-9.17.1 SUSE Linux Enterprise Server 12-SP4-LTSS (src): python-libmount-2.29.2-9.17.1, util-linux-2.29.2-9.17.1, util-linux-systemd-2.29.2-9.17.1 NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination. |