Repository navigation
Conversation
fstrim always trims the whole filesystem, but every bind mount of a pool (for example /var/lib/docker) was trimmed again. Keep one mount per MAJ:MIN, preferring the mount of the filesystem root.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
ChangesSSD trim mount selection
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to
|
🔧 PR Test Plugin AvailableA test plugin has been generated for this PR that includes the modified files. Version: 📥 Installation Instructions:Install via Unraid Web UI:
Alternative: Direct Download
|
Fixes #2796.
xfs_btrfs_trim()ranfstrimon every btrfs/xfs mount with a/dev/source, bind mounts included (their source is/dev/xxx[/subdir]).fstrimtrims the whole filesystem whatever mount point it gets, so a pool with bind mounts (for example/var/lib/dockeron a Docker directory) was trimmed once per mount.The mount list now also selects
MAJ:MINandFSROOT, keeps one entry perMAJ:MIN(one per filesystem; the same for every mount of it, including btrfs subvolumes), and prefers the mount of the filesystem root, so the trim result still names the usual mount point. The rest of the function is unchanged.Tested on 7.4.0-rc.1 with a btrfs cache pool that has three bind mounts and six array disks: the list went from 10 entries to 7 (
/mnt/disk1to/mnt/disk6and/mnt/cache),php -lpasses. The output format (target, tab, source) is unchanged, so the handling of mount points with spaces from #2042 is untouched.Summary by CodeRabbit