Use SET_ERROR for constant non-zero return codes

Update many return and assignment statements to follow the convention
of using the SET_ERROR macro when returning a hard-coded non-zero
value from a function. This aids debugging by recording the error
codes in the debug log.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Ned Bass <bass6@llnl.gov>
Closes #6441
This commit is contained in:
Ned Bass
2017-08-02 21:16:12 -07:00
committed by Brian Behlendorf
parent 6710381680
commit ecb2b7dc7f
18 changed files with 46 additions and 46 deletions
+2 -2
View File
@@ -157,7 +157,7 @@ dsl_scan_init(dsl_pool_t *dp, uint64_t txg)
scn->scn_async_destroying) {
spa->spa_errata =
ZPOOL_ERRATA_ZOL_2094_ASYNC_DESTROY;
return (EOVERFLOW);
return (SET_ERROR(EOVERFLOW));
}
bcopy(zaptmp, &scn->scn_phys,
@@ -2081,7 +2081,7 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_t func)
int err = dsl_scrub_set_pause_resume(scn->scn_dp,
POOL_SCRUB_NORMAL);
if (err == 0)
return (ECANCELED);
return (SET_ERROR(ECANCELED));
return (SET_ERROR(err));
}