From a3c98d5728701d455e036d7687e3f7dbbb6100e5 Mon Sep 17 00:00:00 2001 From: TulsiJain Date: Tue, 28 May 2019 14:14:23 -0700 Subject: [PATCH] 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 --- module/zfs/dsl_scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/zfs/dsl_scan.c b/module/zfs/dsl_scan.c index b15c39ac9c..04a439fad5 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 ||