mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-25 03:37:45 +03:00
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:
committed by
Brian Behlendorf
parent
6710381680
commit
ecb2b7dc7f
@@ -595,7 +595,7 @@ out_check:
|
||||
return (PRIV_POLICY(cr, needed_priv, B_FALSE, EPERM, NULL));
|
||||
return (0);
|
||||
#else
|
||||
return (ENOTSUP);
|
||||
return (SET_ERROR(ENOTSUP));
|
||||
#endif /* HAVE_MLSLABEL */
|
||||
}
|
||||
|
||||
@@ -3652,7 +3652,7 @@ zfs_ioc_destroy(zfs_cmd_t *zc)
|
||||
if (err == 0)
|
||||
err = dsl_destroy_head(zc->zc_name);
|
||||
else if (err == ENOENT)
|
||||
err = EEXIST;
|
||||
err = SET_ERROR(EEXIST);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6313,7 +6313,7 @@ zfsdev_getminor(struct file *filp, minor_t *minorp)
|
||||
|
||||
fpd = filp->private_data;
|
||||
if (fpd == NULL)
|
||||
return (EBADF);
|
||||
return (SET_ERROR(EBADF));
|
||||
|
||||
mutex_enter(&zfsdev_state_lock);
|
||||
|
||||
@@ -6331,7 +6331,7 @@ zfsdev_getminor(struct file *filp, minor_t *minorp)
|
||||
|
||||
mutex_exit(&zfsdev_state_lock);
|
||||
|
||||
return (EBADF);
|
||||
return (SET_ERROR(EBADF));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user