mirror_zfs/lib/libzfs
Paul Dagnelie 086105f4c4
Cause zpool scan resume commands to get logged in history
Currently, commands that resume a scrub/errorscrub from a paused state
don't get logged in the pool history. This is because resumes actually
return ECANCELED, instead of 0. This causes the tsd code in the common
ioctl logic to not think the ioctl succeeded, which causes the
log_history ioctl to fail with EPERM. However, for resuming a scrub from
a paused state, ECANCELED is success.

There are two options for how to deal with this. The first is the one
that I implemented here; I can't find a good reason for dmu_scan to
return ECANCELED on resume instead of 0, so let's just not. The only
place we check for the ECANCELED value is in zpool_scan, where we just
convert it back to zero.  However, I am aware that this is changing an
ioctl interface, which I believe is a breaking change. I don't think
it's an important change, but maybe there is someone who relies on it.

The other option that could be implemented is to either allow ECANCELED
specifically from dsl_scan in the common ioctl code, or add a generic
facility to the common ioctl code that allows each command to specify
whether or not success happened, regardless of the return values. I am
open to feedback on which option people think would be better.

Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Paul Dagnelie <paul.dagnelie@klarasystems.com>
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Closes #17301
2025-05-16 13:19:04 -04:00
..
os SPDX: license tags: BSD-2-Clause 2025-03-13 17:56:46 -07:00
.gitignore Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libzfs_changelist.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_config.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_crypto.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_dataset.c Implement allocation size ranges and use for gang leaves (#17111) 2025-05-02 15:32:18 -07:00
libzfs_diff.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_impl.h SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_import.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_iter.c Sort the blocking snapshots list #12751 (#17264) 2025-05-01 17:40:23 -07:00
libzfs_mount.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_pool.c Cause zpool scan resume commands to get logged in history 2025-05-16 13:19:04 -04:00
libzfs_sendrecv.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_status.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs_util.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
libzfs.abi nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist() 2025-04-18 09:22:16 -04:00
libzfs.pc.in Spruce up pkg-config files for libzfs/libzfs_core 2020-09-04 11:11:18 -07:00
libzfs.suppr Library ABI tracking with abigail 2020-11-17 09:18:52 -08:00
Makefile.am Bump SONAME of libzfs and libzpool 2024-10-06 14:49:33 -07:00
THIRDPARTYLICENSE.openssl Fix typos in lib/ 2019-09-02 17:53:27 -07:00
THIRDPARTYLICENSE.openssl.descrip Encryption patch follow-up 2017-10-11 16:54:48 -04:00