The script «/etc/periodic/daily/801.trim-zfs» invokes: zpool trim ${daily_zfs_trim_flags} "${pool}" However, all other Periodic Configuration Files, including «/etc/defaults/periodic.conf», define and document the Variable as: daily_trim_zfs_flags As a Result, ReDefined Trim flags configured via «/etc/periodic.conf» or «/etc/periodic.conf.local» are Silently IgnoRed. This affects FreeBSD 14.3-RELEASE and 15.0-RELEASE. Suggested Fix: - zpool trim ${daily_zfs_trim_flags} "${pool}" + zpool trim ${daily_trim_zfs_flags} "${pool}" Currently «Hot-Fixed» Example of «/etc/periodic.conf.local»: if kldstat -q -m "zfs" 2>"/dev/null" && zpool status -P -t | egrep "[/][Dd][Ee][Vv][/]" | egrep --invert-match --quiet "[(][[:space:]]*[Tt][Rr][Ii][Mm][[:space:]]+[Uu][Nn][Ss][Uu][Pp][Pp][Oo][Rr][Tt][Ee][Dd][[:space:]]*[)]" then # The System contains Devices that SupPort Trim Operations. daily_trim_zfs_enable="Yes" daily_trim_zfs_flags="${daily_trim_zfs_flags%[[:space:]]}${daily_trim_zfs_flags:+" "}--rate "'"$(( 20 << 20 ))"'"" # Maximum Trim Rate 20 MB/S. ReasonAble Performance Penalty for Most HDDs & SSDs. daily_zfs_trim_flags="${daily_zfs_trim_flags%[[:space:]]}${daily_zfs_trim_flags:+" "}--rate "'"$(( 20 << 20 ))"'"" # Due to the Error in «/etc/periodic/daily/801.trim-zfs»… fi
Sorry, the Corrected «Hot-Fixed» Code for «/etc/periodic.conf», «/etc/periodic.conf.local», «/usr/local/etc/periodic.conf» WithOut Extra-Quotes looks like: if kldstat -q -m "zfs" 2>"/dev/null" && zpool status -P -t | egrep "[/][Dd][Ee][Vv][/]" | egrep --invert-match --quiet "[(][[:space:]]*[Tt][Rr][Ii][Mm][[:space:]]+[Uu][Nn][Ss][Uu][Pp][Pp][Oo][Rr][Tt][Ee][Dd][[:space:]]*[)]" then # The System contains Devices that SupPort Trim Operations. daily_trim_zfs_enable="Yes" daily_trim_zfs_flags="${daily_trim_zfs_flags%[[:space:]]}${daily_trim_zfs_flags:+" "}--rate $(( 20 << 20 ))" # Maximum Trim Rate 20 MB/S. ReasonAble Performance Penalty for Most HDDs & SSDs. daily_zfs_trim_flags="${daily_zfs_trim_flags%[[:space:]]}${daily_zfs_trim_flags:+" "}--rate $(( 20 << 20 ))" # Due to the Error in «/etc/periodic/daily/801.trim-zfs»… fi
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=68d6abd9714384a41028dc0d5086b4930366bbea commit 68d6abd9714384a41028dc0d5086b4930366bbea Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2026-01-01 17:53:31 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-01-01 17:57:15 +0000 periodic/801.trim-zfs: Fix daily-trim-zfs-flags This variable was named incorrectly, resulting in any specified flags being silently ignored. PR: 292074 MFC after: 3 days Reported by: CrazyMihey@Ya.Ru Fixes: 493908c4b45c (Add a daily zfs trim script) usr.sbin/periodic/etc/daily/801.trim-zfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Good catch. Thanks Mihey!
(In reply to CrazyMihey from comment #1) Thank you very much for the report Mihey! A quick ask for next time: could you please submit the patch as a file instead of in a comment? The latter didn't render correctly on Bugzilla. Cheers and a Happy New Year to you!
(In reply to Enji Cooper from comment #4) Happy New Year! I Just Thing the Author Must Make Changes, Fully UnderStanding, what He Does, Not Just Apply Patches from Here, but I will Work on This…
(In reply to CrazyMihey from comment #5) Much appreciated! Attaching your patch as a file with a reference point for your diff ideally helps speed up the process of getting your hard work reviewed and into a development mainline branch. All the best to you :).
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=77d4961041111ba05ad1c8ff64d7cb848e836624 commit 77d4961041111ba05ad1c8ff64d7cb848e836624 Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2026-01-01 17:53:31 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-01-05 06:15:14 +0000 periodic/801.trim-zfs: Fix daily-trim-zfs-flags This variable was named incorrectly, resulting in any specified flags being silently ignored. PR: 292074 MFC after: 3 days Reported by: CrazyMihey@Ya.Ru Fixes: 493908c4b45c (Add a daily zfs trim script) (cherry picked from commit 68d6abd9714384a41028dc0d5086b4930366bbea) usr.sbin/periodic/etc/daily/801.trim-zfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=9f7f30b8df12bc36c8260f5de52862039d897f03 commit 9f7f30b8df12bc36c8260f5de52862039d897f03 Author: Alexander Ziaee <ziaee@FreeBSD.org> AuthorDate: 2026-01-01 17:53:31 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-08-06 22:17:27 +0000 periodic/801.trim-zfs: Fix daily-trim-zfs-flags This variable was named incorrectly, resulting in any specified flags being silently ignored. PR: 292074 MFC after: 3 days Reported by: CrazyMihey@Ya.Ru Fixes: 493908c4b45c (Add a daily zfs trim script) (cherry picked from commit 68d6abd9714384a41028dc0d5086b4930366bbea) usr.sbin/periodic/etc/daily/801.trim-zfs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)