]> granicus.if.org Git - zfs/commitdiff
Make zfs_async_block_max_blocks handle zero correctly
authorTulsiJain <tulsi.jain@Tulsi-Jains-MacBook-Pro.local>
Tue, 28 May 2019 21:14:23 +0000 (14:14 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 3 Jun 2019 16:40:48 +0000 (09:40 -0700)
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

module/zfs/dsl_scan.c

index b15c39ac9ca9131e6fe6d7615a4ee057a07b7910..04a439fad5c5bcaa2bb0f0f448c7e807062afab2 100644 (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 ||