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 <awalker@ixsystems.com>
This commit is contained in:
Andrew Walker 2024-04-24 07:02:27 -07:00 committed by GitHub
parent 9ec26a2ad9
commit 667c282c97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -372,7 +372,7 @@ zvol_set_volthreading(const char *name, boolean_t value)
{ {
zvol_state_t *zv = zvol_find_by_name(name, RW_NONE); zvol_state_t *zv = zvol_find_by_name(name, RW_NONE);
if (zv == NULL) if (zv == NULL)
return (ENOENT); return (-1);
zv->zv_threading = value; zv->zv_threading = value;
mutex_exit(&zv->zv_state_lock); mutex_exit(&zv->zv_state_lock);
return (0); return (0);