From 667c282c9723d6077b3b6f8df01c77536a72a6a5 Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Wed, 24 Apr 2024 07:02:27 -0700 Subject: [PATCH] Fix return value for setting zvol threading (#230) We must return -1 instead of ENOENT if the special zvol threading property set function can't locate the dataset (this would typically happen with an encypted and unmounted zvol) so that the operation gets inserted properly into the nvlist for operations to set. This is because we want the property to be set once the zvol is decrypted again. Signed-off-by: Andrew Walker --- module/zfs/zvol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 5b6a3f5cb4..a71f373839 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -372,7 +372,7 @@ zvol_set_volthreading(const char *name, boolean_t value) { zvol_state_t *zv = zvol_find_by_name(name, RW_NONE); if (zv == NULL) - return (ENOENT); + return (-1); zv->zv_threading = value; mutex_exit(&zv->zv_state_lock); return (0);