Skip to content

Commit

Permalink
maxinflight can overflow in spa_load_verify_cb()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: George Wilson <[email protected]>
Closes #9272
  • Loading branch information
grwilson authored and tonyhutter committed Jan 22, 2020
1 parent 4ff9026 commit 7e93917
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 7e93917

Please sign in to comment.