From 7e9391730927d9d916471d84b550d6e033fff922 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 2 Sep 2019 22:17:51 -0400 Subject: [PATCH] maxinflight can overflow in spa_load_verify_cb() When running on larger memory systems, we can overflow the value of maxinflight. This can result in maxinflight having a value of 0 causing the system to hang. Reviewed-by: Igor Kozhukhov Reviewed-by: Brian Behlendorf Signed-off-by: George Wilson Closes #9272 --- module/zfs/spa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 7b2a2081f..7a20330c1 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -2137,7 +2137,8 @@ spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, if (!BP_IS_METADATA(bp) && !spa_load_verify_data) return (0); - int maxinflight_bytes = arc_target_bytes() >> spa_load_verify_shift; + uint64_t maxinflight_bytes = + arc_target_bytes() >> spa_load_verify_shift; zio_t *rio = arg; size_t size = BP_GET_PSIZE(bp);