summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorcao <[email protected]>2016-11-10 09:35:26 +0800
committerBrian Behlendorf <[email protected]>2016-11-09 17:35:26 -0800
commit3bfd95d5898b1318f9a5c36d1cc43cf23d004f64 (patch)
tree69b6824b5fa16153be094a5242456e00c80f0b08 /module/zfs
parent7e5ea7be7f69231b66c1affddb870fcea8c3a4d8 (diff)
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 <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5379
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/spa.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index ec6924a02..05e15a2e6 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -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);
/*