From f9e9551e6bcb4c610d60dde4354cc1152676ecd9 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 12 Oct 2015 14:24:11 +0000 Subject: [PATCH] 6251 add tunable to disable free_bpobj processing Reviewed by: Matthew Ahrens Reviewed by: Prakash Surya Reviewed by: Simon Klinkert Reviewed by: Richard Elling Reviewed by: Albert Lee Reviewed by: Xin Li Approved by: Garrett D'Amore Author: George Wilson illumos/illumos-gate@139510fb6efa97dbe5f5479594b308d940cab8d1 --- uts/common/fs/zfs/dsl_scan.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/uts/common/fs/zfs/dsl_scan.c b/uts/common/fs/zfs/dsl_scan.c index ba397b1bb0cb..6ba5cb6a1c83 100644 --- a/uts/common/fs/zfs/dsl_scan.c +++ b/uts/common/fs/zfs/dsl_scan.c @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #include @@ -78,6 +78,11 @@ uint64_t zfs_free_max_blocks = UINT64_MAX; extern int zfs_txg_timeout; +/* + * Enable/disable the processing of the free_bpobj object. + */ +boolean_t zfs_free_bpobj_enabled = B_TRUE; + /* the order has to match pool_scan_type */ static scan_cb_t *scan_funcs[POOL_SCAN_FUNCS] = { NULL, @@ -1426,7 +1431,8 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t *tx) * have to worry about traversing it. It is also faster to free the * blocks than to scrub them. */ - if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { + if (zfs_free_bpobj_enabled && + spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) { scn->scn_is_bptree = B_FALSE; scn->scn_zio_root = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED);