Skip to content

Commit

Permalink
Wrap bare EINVAL returns with SET_ERROR
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11636
  • Loading branch information
Ryan Moeller authored Feb 24, 2021
1 parent 94fa1c3 commit 5156862
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit 5156862

Please sign in to comment.