Bug ID 1089529
Summary fstrim -a skips filesystem if there are bind or rbind mounts on it
Classification openSUSE
Product openSUSE Distribution
Version Leap 42.3
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Basesystem
Assignee bnc-team-screening@forge.provo.novell.com
Reporter nettezzaumanaa@gmail.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

hello,

`fstrim -av' skips trimming fs if there are bind mounts:

# fstrim -av; echo $?; fstrim -v /home
/boot: 0 B (0 bytes) trimmed
/: 295.1 MiB (309415936 bytes) trimmed
0
/home: 1 GiB (1077309440 bytes) trimmed



once unmounted, it works

# mount | grep /home
/dev/mapper/rpool-home on /home type ext4 (rw,relatime,data=ordered)
tmpfs on /home/dpecka/mnt type tmpfs (rw,nosuid,nodev,mode=755)
/dev/mapper/rpool-home on /home/dpecka/+work/vbox-shared/cases type ext4
(rw,relatime,data=ordered)

# grep bind /etc/fstab 
### (r)binds
/var/run/media/dpecka   /home/dpecka/mnt        none    rbind   0 0
/home/dpecka/+work/cases /home/dpecka/+work/vbox-shared/cases/  none bind      
0 0

# umount /home/dpecka/mnt
# umount /home/dpecka/+work/vbox-shared/cases

# fstrim -av
/home: 437.9 MiB (459116544 bytes) trimmed
/boot: 0 B (0 bytes) trimmed
/: 60.5 MiB (63377408 bytes) trimmed

reproducible in 100% cases ..

Impact is, that for example fstrim service doesn't work properly

# journalctl -b -2 -u fstrim.service
-- Logs begin at Thu 2017-06-29 16:23:45 CEST, end at Fri 2018-04-13 16:15:01
CEST. --
Apr 10 00:08:09 linux-ea8q.suse systemd[1]: Starting Discard unused blocks...
Apr 10 00:08:49 linux-ea8q.suse fstrim[25447]: /boot: 170.8 MiB (179084288
bytes) trimmed
Apr 10 00:08:49 linux-ea8q.suse fstrim[25447]: /: 6.9 GiB (7372636160 bytes)
trimmed
Apr 10 00:08:49 linux-ea8q.suse systemd[1]: Started Discard unused blocks.
Apr 11 00:00:01 linux-ea8q.suse systemd[1]: Starting Discard unused blocks...
Apr 11 00:00:09 linux-ea8q.suse fstrim[721]: /boot: 0 B (0 bytes) trimmed
Apr 11 00:00:09 linux-ea8q.suse fstrim[721]: /: 1.3 GiB (1344610304 bytes)
trimmed
Apr 11 00:00:09 linux-ea8q.suse systemd[1]: Started Discard unused blocks.
Apr 12 00:00:01 linux-ea8q.suse systemd[1]: Starting Discard unused blocks...
Apr 12 00:00:07 linux-ea8q.suse fstrim[20086]: /boot: 0 B (0 bytes) trimmed
Apr 12 00:00:07 linux-ea8q.suse fstrim[20086]: /: 1.3 GiB (1339502592 bytes)
trimmed
Apr 12 00:00:07 linux-ea8q.suse systemd[1]: Started Discard unused blocks.
Apr 13 00:00:01 linux-ea8q.suse systemd[1]: Starting Discard unused blocks...
Apr 13 00:00:13 linux-ea8q.suse fstrim[9616]: /boot: 0 B (0 bytes) trimmed
Apr 13 00:00:13 linux-ea8q.suse fstrim[9616]: /: 1.4 GiB (1445236736 bytes)
trimmed
Apr 13 00:00:13 linux-ea8q.suse systemd[1]: Started Discard unused blocks.



# systemctl cat fstrim.service 
# /usr/lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks

[Service]
Type=oneshot
ExecStart=/usr/sbin/fstrim -av

# /etc/systemd/system/fstrim.service.d/service.conf
[Service]
ExecStart=
ExecStart=/usr/sbin/fstrim -av



regards, daniel


You are receiving this mail because: