]> git.proxmox.com Git - mirror_zfs.git/commit
Rework error handling in zpool_trim()
authorJohn Gallagher <jgallag88@gmail.com>
Thu, 28 May 2020 00:27:28 +0000 (17:27 -0700)
committerGitHub <noreply@github.com>
Thu, 28 May 2020 00:27:28 +0000 (17:27 -0700)
commit50ff632787876494ca4138ad3a178e97dbf9c0a5
treef130681cfbbeab650452da1f1f0e2eed0ead3c23
parent40f96f46434633aedd1820980a4c84097cfb7ea7
Rework error handling in zpool_trim()

When a manual trim is run against an entire pool, errors about
particular devices which don't support trim are suppressed. This changes
zpool_trim() in libzfs so that it doesn't return an error when the only
errors are suppressed ones. An exception is made when none of the
devices support trim, in which case an error is reported and a non-zero
status is returned.

This also fixes how the --wait flag works in the presence of suppressed
errors. In particular, suppressed errors no longer cause zpool_trim()
to skip the wait.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: John Gallagher <john.gallagher@delphix.com>
Closes #10263
Closes #10372
lib/libzfs/libzfs_pool.c