From: TulsiJain Date: Tue, 28 May 2019 21:14:23 +0000 (-0700) Subject: Make zfs_async_block_max_blocks handle zero correctly X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3c98d5728701d455e036d7687e3f7dbbb6100e5;p=zfs Make zfs_async_block_max_blocks handle zero correctly Reviewed-by: Matt Ahrens Reviewed-by: Paul Dagnelie Reviewed-by: Brian Behlendorf Signed-off-by: TulsiJain Closes #8829 Closes #8289 --- diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index b15c39ac9..04a439fad 100644 --- a/module/zfs/dsl_scan.c +++ b/module/zfs/dsl_scan.c @@ -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 ||