zdb -d has false positive warning when feature@large_blocks=disabled

Skip large blocks feature refcount checking if feature is disabled.

Signed-off-by: Don Brady <don.brady@intel.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3468
This commit is contained in:
Don Brady 2015-06-24 22:05:32 -06:00 committed by Brian Behlendorf
parent 16421a1dc8
commit 784652c1f0
1 changed files with 16 additions and 11 deletions

View File

@ -22,6 +22,7 @@
/* /*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2015, Intel Corporation.
*/ */
#include <stdio.h> #include <stdio.h>
@ -3086,6 +3087,7 @@ dump_zpool(spa_t *spa)
if (dump_opt['d'] || dump_opt['i']) { if (dump_opt['d'] || dump_opt['i']) {
uint64_t refcount; uint64_t refcount;
dump_dir(dp->dp_meta_objset); dump_dir(dp->dp_meta_objset);
if (dump_opt['d'] >= 3) { if (dump_opt['d'] >= 3) {
dump_full_bpobj(&spa->spa_deferred_bpobj, dump_full_bpobj(&spa->spa_deferred_bpobj,
@ -3107,17 +3109,20 @@ dump_zpool(spa_t *spa)
(void) dmu_objset_find(spa_name(spa), dump_one_dir, (void) dmu_objset_find(spa_name(spa), dump_one_dir,
NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN);
(void) feature_get_refcount(spa, if (feature_get_refcount(spa,
&spa_feature_table[SPA_FEATURE_LARGE_BLOCKS], &refcount); &spa_feature_table[SPA_FEATURE_LARGE_BLOCKS],
if (num_large_blocks != refcount) { &refcount) != ENOTSUP) {
(void) printf("large_blocks feature refcount mismatch: " if (num_large_blocks != refcount) {
"expected %lld != actual %lld\n", (void) printf("large_blocks feature refcount "
(longlong_t)num_large_blocks, "mismatch: expected %lld != actual %lld\n",
(longlong_t)refcount); (longlong_t)num_large_blocks,
rc = 2; (longlong_t)refcount);
} else { rc = 2;
(void) printf("Verified large_blocks feature refcount " } else {
"is correct (%llu)\n", (longlong_t)refcount); (void) printf("Verified large_blocks feature "
"refcount is correct (%llu)\n",
(longlong_t)refcount);
}
} }
} }
if (rc == 0 && (dump_opt['b'] || dump_opt['c'])) if (rc == 0 && (dump_opt['b'] || dump_opt['c']))