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 <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: George Wilson <george.wilson@delphix.com>
Closes #9272
This commit is contained in:
George Wilson 2019-09-02 22:17:51 -04:00 committed by Tony Hutter
parent 4ff90260c0
commit 7e93917309

View File

@ -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);