mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Fix coverity defects: CID 147540, 147542
CID 147540: unsigned_compare - Cast nsec to a int32_t to properly detect the expected overflow. CID 147542: unsigned_compare - intval can never be less than ZIO_FAILURE_MODE_WAIT which is defined to be zero. Remove this useless check. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn> Closes #5379
This commit is contained in:
+1
-2
@@ -555,8 +555,7 @@ spa_prop_validate(spa_t *spa, nvlist_t *props)
|
||||
|
||||
case ZPOOL_PROP_FAILUREMODE:
|
||||
error = nvpair_value_uint64(elem, &intval);
|
||||
if (!error && (intval < ZIO_FAILURE_MODE_WAIT ||
|
||||
intval > ZIO_FAILURE_MODE_PANIC))
|
||||
if (!error && intval > ZIO_FAILURE_MODE_PANIC)
|
||||
error = SET_ERROR(EINVAL);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user