Print this page
@@ -52,10 +52,11 @@
#include <sys/zfs_fuid.h>
#include <sys/arc.h>
#undef ZFS_MAXNAMELEN
#undef verify
#include <libzfs.h>
+#include <sys/zio_crypt.h>
const char cmdname[] = "zdb";
uint8_t dump_opt[256];
typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
@@ -63,11 +64,11 @@
extern void dump_intent_log(zilog_t *);
uint64_t *zopt_object = NULL;
int zopt_objects = 0;
libzfs_handle_t *g_zfs;
boolean_t zdb_sig_user_data = B_TRUE;
-int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256;
+int zdb_sig_cksumalg = ZIO_CHECKSUM_FUNCTIONS - 1;
/*
* These libumem hooks provide a reasonable set of defaults for the allocator's
* debugging facilities.
*/
@@ -1070,10 +1071,15 @@
if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6) {
(void) snprintf(aux + strlen(aux), sizeof (aux), " (Z=%s)",
zio_compress_table[doi.doi_compress].ci_name);
}
+ if (doi.doi_crypt != ZIO_CRYPT_INHERIT || verbosity >= 6) {
+ (void) snprintf(aux + strlen(aux), sizeof (aux), " (E=%s)",
+ zio_crypt_table[doi.doi_crypt].ci_name);
+ }
+
(void) printf("%10lld %3u %5s %5s %5s %5s %s%s\n",
(u_longlong_t)object, doi.doi_indirection, iblk, dblk, lsize,
asize, dmu_ot[doi.doi_type].ot_name, aux);
if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) {
@@ -1477,18 +1483,19 @@
if (BP_GET_CHECKSUM(bp) < zdb_sig_cksumalg)
print_sig = B_FALSE;
if (print_sig) {
- (void) printf("%llu\t%lld\t%lld\t%s\t%s\t%s\t"
+ (void) printf("%llu\t%lld\t%lld\t%s\t%s\t%s\t%s\t"
"%llx:%llx:%llx:%llx\n",
(u_longlong_t)BP_GET_LEVEL(bp),
(longlong_t)BP_GET_PSIZE(bp),
(longlong_t)BP_GET_NDVAS(bp),
dmu_ot[BP_GET_TYPE(bp)].ot_name,
zio_checksum_table[BP_GET_CHECKSUM(bp)].ci_name,
zio_compress_table[BP_GET_COMPRESS(bp)].ci_name,
+ zio_crypt_table[BP_GET_CRYPT(bp)].ci_name,
(u_longlong_t)bp->blk_cksum.zc_word[0],
(u_longlong_t)bp->blk_cksum.zc_word[1],
(u_longlong_t)bp->blk_cksum.zc_word[2],
(u_longlong_t)bp->blk_cksum.zc_word[3]);
}
@@ -1843,13 +1850,14 @@
BP_GET_BYTEORDER(bp) ? "LITTLE" : "BIG",
dmu_ot[BP_GET_TYPE(bp)].ot_name);
(void) printf("\tBIRTH: %-16llx LEVEL: %-2llu\tFILL: %llx\n",
(u_longlong_t)bp->blk_birth, (u_longlong_t)BP_GET_LEVEL(bp),
(u_longlong_t)bp->blk_fill);
- (void) printf("\tCKFUNC: %-16s\t\tCOMP: %s\n",
+ (void) printf("\tCKFUNC: %-16s\t\tCOMP: %s\t\tCRYPT: %s\n",
zio_checksum_table[BP_GET_CHECKSUM(bp)].ci_name,
- zio_compress_table[BP_GET_COMPRESS(bp)].ci_name);
+ zio_compress_table[BP_GET_COMPRESS(bp)].ci_name,
+ zio_crypt_table[BP_GET_CRYPT(bp)].ci_name);
(void) printf("\tCKSUM: %llx:%llx:%llx:%llx\n",
(u_longlong_t)bp->blk_cksum.zc_word[0],
(u_longlong_t)bp->blk_cksum.zc_word[1],
(u_longlong_t)bp->blk_cksum.zc_word[2],
(u_longlong_t)bp->blk_cksum.zc_word[3]);
@@ -2295,10 +2303,12 @@
zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_2;
else if (strcmp(endstr, "fletcher4") == 0)
zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_4;
else if (strcmp(endstr, "sha256") == 0)
zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256;
+ else if (strcmp(endstr, "sha256+mac") == 0)
+ zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256_MAC;
else if (strcmp(endstr, "all") == 0)
zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_2;
else
usage();
break;