Wrap bare EINVAL returns with SET_ERROR

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11636
This commit is contained in:
Ryan Moeller 2021-02-24 12:51:10 -05:00 committed by GitHub
parent 94fa1c3d96
commit 5156862960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3986,7 +3986,7 @@ zfs_ioc_pool_initialize(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl)
fnvlist_free(vdev_errlist);
spa_close(spa, FTAG);
return (total_errors > 0 ? EINVAL : 0);
return (total_errors > 0 ? SET_ERROR(EINVAL) : 0);
}
/*
@ -4071,7 +4071,7 @@ zfs_ioc_pool_trim(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl)
fnvlist_free(vdev_errlist);
spa_close(spa, FTAG);
return (total_errors > 0 ? EINVAL : 0);
return (total_errors > 0 ? SET_ERROR(EINVAL) : 0);
}
/*