trim script outputs error if no devices in pool support trim

Bug #1942712 reported by Brett Frankenberger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zfs-linux (Ubuntu)
New
Undecided
Unassigned

Bug Description

/usr/lib/zfs-linux/trim, which is run on the first Sunday of every month via an entry in /etc/cron.d/zfsutils-linux, outputs the following message if a pool has no devices that support TRIM:

   cannot trim: no devices in pool support trim operations

When this occurs via the crontab entry, the result is that cron sends an E-Mail to root with the output. So systems which have ZFS configured on a device that does not support TRIM (which includes not just legacy HDD's, but also dm-crypt devices (by default) even if they have an SSD lower layer) will get a nuisance E-Mail every month.

% lsb_release -rd
Description: Ubuntu 21.04
Release: 21.04

% apt-cache policy zfsutils-linux
zfsutils-linux:
  Installed: 2.0.2-1ubuntu5.1
  Candidate: 2.0.2-1ubuntu5.1
    [ . . . ]

: What I expected to happen
The cronjob to silently complete without sending an error message (in the case where the only issue is that the pool has no devices that support TRTM)

: What happened instead
The crontab caused an E-Mail with the above mentioned error message to be send to root

(Note that there appears to be logic in the script to cause it to continue past such pools. But that doesn't prevent the message from being output and E-Mailed.)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.