[Bug 292074] periodic daily 801.trim-zfs uses wrong variable name: daily_zfs_trim_flags instead of daily_trim_zfs_flags

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 31 Dec 2025 15:47:56 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=292074

            Bug ID: 292074
           Summary: periodic daily 801.trim-zfs uses wrong variable name:
                    daily_zfs_trim_flags instead of daily_trim_zfs_flags
           Product: Base System
           Version: 15.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: CrazyMihey@Ya.Ru

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

-- 
You are receiving this mail because:
You are the assignee for the bug.