Skip to content

Commit 784652c

Browse files
Don Bradybehlendorf
authored andcommitted
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
1 parent 16421a1 commit 784652c

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

cmd/zdb/zdb.c

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
/*
2323
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2424
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
25+
* Copyright (c) 2015, Intel Corporation.
2526
*/
2627

2728
#include <stdio.h>
@@ -3086,6 +3087,7 @@ dump_zpool(spa_t *spa)
30863087

30873088
if (dump_opt['d'] || dump_opt['i']) {
30883089
uint64_t refcount;
3090+
30893091
dump_dir(dp->dp_meta_objset);
30903092
if (dump_opt['d'] >= 3) {
30913093
dump_full_bpobj(&spa->spa_deferred_bpobj,
@@ -3107,17 +3109,20 @@ dump_zpool(spa_t *spa)
31073109
(void) dmu_objset_find(spa_name(spa), dump_one_dir,
31083110
NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN);
31093111

3110-
(void) feature_get_refcount(spa,
3111-
&spa_feature_table[SPA_FEATURE_LARGE_BLOCKS], &refcount);
3112-
if (num_large_blocks != refcount) {
3113-
(void) printf("large_blocks feature refcount mismatch: "
3114-
"expected %lld != actual %lld\n",
3115-
(longlong_t)num_large_blocks,
3116-
(longlong_t)refcount);
3117-
rc = 2;
3118-
} else {
3119-
(void) printf("Verified large_blocks feature refcount "
3120-
"is correct (%llu)\n", (longlong_t)refcount);
3112+
if (feature_get_refcount(spa,
3113+
&spa_feature_table[SPA_FEATURE_LARGE_BLOCKS],
3114+
&refcount) != ENOTSUP) {
3115+
if (num_large_blocks != refcount) {
3116+
(void) printf("large_blocks feature refcount "
3117+
"mismatch: expected %lld != actual %lld\n",
3118+
(longlong_t)num_large_blocks,
3119+
(longlong_t)refcount);
3120+
rc = 2;
3121+
} else {
3122+
(void) printf("Verified large_blocks feature "
3123+
"refcount is correct (%llu)\n",
3124+
(longlong_t)refcount);
3125+
}
31213126
}
31223127
}
31233128
if (rc == 0 && (dump_opt['b'] || dump_opt['c']))

0 commit comments

Comments
 (0)