]> granicus.if.org Git - zfs/commitdiff
maxinflight can overflow in spa_load_verify_cb()
authorGeorge Wilson <george.wilson@delphix.com>
Tue, 3 Sep 2019 02:17:51 +0000 (22:17 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 3 Sep 2019 02:17:51 +0000 (19:17 -0700)
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

module/zfs/spa.c

index f4a6f3f456b82190a2301d77c8f7d0557a56d83b..d885c20c9256125da958600e01cc0abb6410691c 100644 (file)
@@ -2229,7 +2229,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);