[Bug 1106214] New: fstrim attempts to auto trim partition without being told to and gives unclear feedback
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214 Bug ID: 1106214 Summary: fstrim attempts to auto trim partition without being told to and gives unclear feedback Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.0 Hardware: x86-64 OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: bnc-team-screening@forge.provo.novell.com Reporter: studio@anchev.net QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- # journalctl --since=2018-01-01 | grep -i fstrim | grep -iE "/win" Jul 30 00:00:01 pc fstrim[28765]: fstrim: /win: FITRIM ioctl failed: Bad file descriptor Aug 06 00:00:05 pc fstrim[8933]: fstrim: /win: FITRIM ioctl failed: Bad file descriptor Aug 20 13:17:49 pc fstrim[2118]: fstrim: /win: FITRIM ioctl failed: Bad file descriptor Aug 27 00:00:06 pc fstrim[6762]: fstrim: /win: FITRIM ioctl failed: Bad file descriptor NOTE: This system was upgraded from Leap 42.3 to Leap 15.0 on 2018-07-24 and there are no such messages before that date. So it seems related to Leap 15. # tree /etc/cron.* /etc/cron.d ├── mdadm └── unbound-anchor /etc/cron.daily ├── mdadm ├── mlocate.cron ├── suse-clean_catman ├── suse-do_mandb └── trim /etc/cron.deny [error opening dir] /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly 0 directories, 7 files # cat /etc/cron.daily/trim #!/bin/sh LOG=/var/log/trim.log echo "*** $(date -R) ***" >> $LOG fstrim -v / >> $LOG The above short script has been working correctly for years and still works fine. However it does not attempt to trim the '/win' partition. So there is something else which does that. Running manually the command shows the same message: # fstrim -v /win fstrim: /win: FITRIM ioctl failed: Bad file descriptor The mount options for this ntfs-3g partition are: ro,noatime,permissions,uid=myusername,gid=users,fmask=177,dmask=077,locale=en_US.UTF-8,windows_names 0 0 Removing the 'ro' option fixes the problem and the partition is trimmed correctly. EXPECTED: - do not fstrim partitions automatically without being told to - do not fstrim read-only partitions and give a clearer feedback message when there is an attempt to do it ACTUAL: - fstrim obviously does attempt auto trim a partition without being told to do so - fstrim attempts to trim a read-only partition and outputs a message which doesn't clearly say that the failure is due to the 'ro' mount -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c2
--- Comment #2 from George Anchev
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c3
Iakov Karpov
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c4
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c5
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c6
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c7
--- Comment #7 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c8
--- Comment #8 from Iakov Karpov
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. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c9
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c11
--- Comment #11 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214
http://bugzilla.opensuse.org/show_bug.cgi?id=1106214#c16
Stanislav Brabec
participants (1)
-
bugzilla_noreply@novell.com