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 Tony Hutter
parent 6150fbe67f
commit 818bc70c32
1 changed files with 2 additions and 2 deletions

View File

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