Make zfs_async_block_max_blocks handle zero correctly

Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: TulsiJain <tulsi.jain@delphix.com>
Closes #8829
Closes #8289
This commit is contained in:
TulsiJain 2019-05-28 14:14:23 -07:00 committed by Brian Behlendorf
parent 2531ce3720
commit a3c98d5728
1 changed files with 3 additions and 1 deletions

View File

@ -3025,8 +3025,10 @@ dsl_scan_async_block_should_pause(dsl_scan_t *scn)
if (zfs_recover)
return (B_FALSE);
if (scn->scn_visited_this_txg >= zfs_async_block_max_blocks)
if (zfs_async_block_max_blocks != 0 &&
scn->scn_visited_this_txg >= zfs_async_block_max_blocks) {
return (B_TRUE);
}
elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time;
return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout ||