[Bug 1127701] New: fstrim -Av runs trim on each btrfs subvolume
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Bug ID: 1127701 Summary: fstrim -Av runs trim on each btrfs subvolume Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: asn@cryptomilk.org QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- fstrim -Av runs trim on each btrfs subvolume $ magrathea:~ # fstrim -Av /.snapshots: 23 GiB (24640622592 bytes) trimmed on /dev/sda3 /var/tmp: 25.7 GiB (27602243584 bytes) trimmed on /dev/sda3 /var/spool: 29.9 GiB (32058798080 bytes) trimmed on /dev/sda3 /var/opt: 29 GiB (31094824960 bytes) trimmed on /dev/sda3 ... $ mount /dev/sda3 on /.snapshots type btrfs (rw,relatime,ssd,space_cache,subvolid=258,subvol=/@/.snapshots) /dev/sda3 on /var/tmp type btrfs (rw,relatime,ssd,space_cache,subvolid=278,subvol=/@/var/tmp) /dev/sda3 on /var/spool type btrfs (rw,relatime,ssd,space_cache,subvolid=277,subvol=/@/var/spool) /dev/sda3 on /var/opt type btrfs (rw,relatime,ssd,space_cache,subvolid=276,subvol=/@/var/opt) ... This is basically bug #1020077 again, but this time with -A instead of -a! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Andreas Schneider <asn@cryptomilk.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |asn@cryptomilk.org, | |sbrabec@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c1 Stanislav Brabec <sbrabec@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED --- Comment #1 from Stanislav Brabec <sbrabec@suse.com> --- It requires another way to de-duplicate. fstrim -A works perfectly as long as fstab contains device names. If the source is specified by UUID=, then it fails to de-duplicate. Tested on this setup: Works: /dev/loop0 /mnt/1 btrfs defaults 0 0 /dev/loop0 /mnt/2 btrfs subvol=/subvol 0 0 /dev/loop0 /mnt/3 btrfs subvol=/subvol2 0 0 Broken: UUID=cb4cf1ab-b586-4980-bd7f-92422bc8f082 /mnt/1 btrfs defaults 0 0 UUID=cb4cf1ab-b586-4980-bd7f-92422bc8f082 /mnt/2 btrfs subvol=/subvol 0 0 UUID=cb4cf1ab-b586-4980-bd7f-92422bc8f082 /mnt/3 btrfs subvol=/subvol2 0 0 Additionally, /dev/root also needs testing (in case, when subvolumes use real device name). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Jiachen Zhang <jiachen.zhang@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|bnc-team-screening@forge.pr |sbrabec@suse.com |ovo.novell.com | -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c2 Stanislav Brabec <sbrabec@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |IN_PROGRESS --- Comment #2 from Stanislav Brabec <sbrabec@suse.com> --- It looks like a logical error in the sys-utils/fstrim.c: fstrim_all(). De-duplication of items is performed too early. First it calls mnt_new_table_from_file(filename); In case of "fstrim -a", it reads /proc/self/mountinfo, in case of "fstrim -A", it reads /etc/fstab. But in case of source in the UUID= format, mnt_fs_get_srcpath(fs) returns NULL. On that table, de-duplication is called: mnt_table_uniq_fs(tab, MNT_UNIQ_FORWARD, uniq_fs_source_cmp); De-duplication by source is performed on unprocessed /etc/fstab, so de-duplication by source is not possible. One has to call: mnt_resolve_spec(mnt_fs_get_source(fs), cache); to resolve the source. It is really done, but after the de-duplication, just before calling fstrim_filesystem() itself. It is too late to de-duplicate. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c4 --- Comment #4 from Stanislav Brabec <sbrabec@suse.com> --- I started to work on this bug. After the fix, the update process will be started for all supported products. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c5 --- Comment #5 from Stanislav Brabec <sbrabec@suse.com> --- The de-duplication of fstab is more complicated than "fstrim -a", as it needs to evaluate tags, bind mounts, pseudo filesystems and everything else that "mount -a" does. Otherwise de-duplication can fail in many ways (use source specified by tags, subvolumes as source, bind mounts, false evaluation of pseudo or net filesystem path). The core of the path evaluation is implemented in mnt_context_prepare_srcpath(). But it is not possible to use it directly in fstrim. mnt_context_prepare_srcpath() uses libmnt_context structure, but the de-duplication functions mnt_table_uniq_fs() use libmnt_table and libmnt_fs. So there are several options to implement this: 1. Rewrite fstrim.c to use libmnt_context instead of libmnt_fs (libmnt_context is a superset of libmnt_fs), and then use mnt_context_prepare_srcpath() and then de-duplicate. 2. Use parts of mount_all() code to perform full parsing of fstab, and then fill table with evaluated and canonicalized srcpath. 3. Implement mnt_fs_prepare_srcpath() as a counterpart of mnt_context_prepare_srcpath(). 4. Create a temporary libmnt_context for performing the tag evaluation and canonicalization. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c6 --- Comment #6 from Andreas Schneider <asn@cryptomilk.org> --- If in future mode code in fstrim.c will use or should use libmnt_context then I would do a rewrite to have clean code to work with in future. You can do 4. for backporting and then do 1. the new releases ... Just my 2 cents :-) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c7 --- Comment #7 from Stanislav Brabec <sbrabec@suse.com> --- It seems that use of mnt_context makes only a little sense for the rest of fstrim_all() (and for the rest of the fstrim, we don't need these structures at all). Additionally, we cannot use mnt_context_prepare_srcpath() anyway. In case of loop device inside fstab, it is going to initialize the loop device again, which would be pretty ugly, even if recent libmount has a loop dep-duplication code. It complicates 1. and 4. So 2. or 3. seems to be the best solution. I am trying to finish 3. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Whiteboard| |ibs:running:12022:moderate -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c18 --- Comment #18 from Andreas Schneider <asn@cryptomilk.org> --- Is this already fixed in Tumbleweed. I can't really find something in the changelog. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c19 --- Comment #19 from Stanislav Brabec <sbrabec@suse.com> --- True, not yet. git describe --contains 2d22ac64e4d6e6732640f38b7232b5bcdc84a877 v2.34~26 util-linux-2.34 was released last week. Sent to Factory: https://build.opensuse.org/request/show/719009 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c21 ravas mi <ravas@tuta.io> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ravas@tuta.io --- Comment #21 from ravas mi <ravas@tuta.io> --- I just upgraded to 20190828, which included a util-linux update. Running fstrim -Av now shows /, /home and /boot/efi as being trimmed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c22 --- Comment #22 from Stanislav Brabec <sbrabec@suse.com> --- Thanks for confirmation. I suppose that you have these on 3 partitions. I will close the bug once it will be published for released products. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c23 --- Comment #23 from ravas mi <ravas@tuta.io> ---
"I suppose that you have these on 3 partitions."
Correct. Thank you for the substantial bug fix! -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Whiteboard|ibs:running:12022:moderate | -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Whiteboard| |obs:running:11017:moderate -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c24 --- Comment #24 from Swamp Workflow Management <swamp@suse.de> --- 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. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c25 --- Comment #25 from Swamp Workflow Management <swamp@suse.de> --- 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 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 http://bugzilla.suse.com/show_bug.cgi?id=1127701#c26 Stanislav Brabec <sbrabec@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED --- Comment #26 from Stanislav Brabec <sbrabec@suse.com> --- The fix was just released. Closing. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.suse.com/show_bug.cgi?id=1127701 Swamp Workflow Management <swamp@suse.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Whiteboard|obs:running:11017:moderate | -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1127701 https://bugzilla.suse.com/show_bug.cgi?id=1127701#c27 Stanislav Brabec <sbrabec@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pujos.michael@gmail.com --- Comment #27 from Stanislav Brabec <sbrabec@suse.com> --- *** Bug 1131432 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are on the CC list for the bug.
participants (2)
-
bugzilla_noreply@novell.com
-
bugzilla_noreply@suse.com