zdb.c (208047) | zdb.c (209962) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE --- 5 unchanged lines hidden (view full) --- 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21/* |
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. 24 */ 25 26#include <stdio.h> 27#include <stdio_ext.h> 28#include <stdlib.h> 29#include <ctype.h> 30#include <sys/zfs_context.h> --- 51 unchanged lines hidden (view full) --- 82{ 83 return ("fail,contents"); /* $UMEM_LOGGING setting */ 84} 85 86static void 87usage(void) 88{ 89 (void) fprintf(stderr, | 23 * Use is subject to license terms. 24 */ 25 26#include <stdio.h> 27#include <stdio_ext.h> 28#include <stdlib.h> 29#include <ctype.h> 30#include <sys/zfs_context.h> --- 51 unchanged lines hidden (view full) --- 82{ 83 return ("fail,contents"); /* $UMEM_LOGGING setting */ 84} 85 86static void 87usage(void) 88{ 89 (void) fprintf(stderr, |
90 "Usage: %s [-udibcsv] [-U cachefile_path] " 91 "[-S user:cksumalg] " | 90 "Usage: %s [-udibcsvL] [-U cachefile_path] [-t txg]\n" 91 "\t [-S user:cksumalg] " |
92 "dataset [object...]\n" 93 " %s -C [pool]\n" 94 " %s -l dev\n" 95 " %s -R pool:vdev:offset:size:flags\n" 96 " %s [-p path_to_vdev_dir]\n" 97 " %s -e pool | GUID | devid ...\n", 98 cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); 99 100 (void) fprintf(stderr, " -u uberblock\n"); 101 (void) fprintf(stderr, " -d datasets\n"); 102 (void) fprintf(stderr, " -C cached pool configuration\n"); 103 (void) fprintf(stderr, " -i intent logs\n"); 104 (void) fprintf(stderr, " -b block statistics\n"); | 92 "dataset [object...]\n" 93 " %s -C [pool]\n" 94 " %s -l dev\n" 95 " %s -R pool:vdev:offset:size:flags\n" 96 " %s [-p path_to_vdev_dir]\n" 97 " %s -e pool | GUID | devid ...\n", 98 cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); 99 100 (void) fprintf(stderr, " -u uberblock\n"); 101 (void) fprintf(stderr, " -d datasets\n"); 102 (void) fprintf(stderr, " -C cached pool configuration\n"); 103 (void) fprintf(stderr, " -i intent logs\n"); 104 (void) fprintf(stderr, " -b block statistics\n"); |
105 (void) fprintf(stderr, " -c checksum all data blocks\n"); | 105 (void) fprintf(stderr, " -m metaslabs\n"); 106 (void) fprintf(stderr, " -c checksum all metadata (twice for " 107 "all data) blocks\n"); |
106 (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); 107 (void) fprintf(stderr, " -S <user|all>:<cksum_alg|all> -- " 108 "dump blkptr signatures\n"); 109 (void) fprintf(stderr, " -v verbose (applies to all others)\n"); 110 (void) fprintf(stderr, " -l dump label contents\n"); | 108 (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); 109 (void) fprintf(stderr, " -S <user|all>:<cksum_alg|all> -- " 110 "dump blkptr signatures\n"); 111 (void) fprintf(stderr, " -v verbose (applies to all others)\n"); 112 (void) fprintf(stderr, " -l dump label contents\n"); |
113 (void) fprintf(stderr, " -L disable leak tracking (do not " 114 "load spacemaps)\n"); |
|
111 (void) fprintf(stderr, " -U cachefile_path -- use alternate " 112 "cachefile\n"); 113 (void) fprintf(stderr, " -R read and display block from a " 114 "device\n"); 115 (void) fprintf(stderr, " -e Pool is exported/destroyed/" 116 "has altroot\n"); 117 (void) fprintf(stderr, " -p <Path to vdev dir> (use with -e)\n"); | 115 (void) fprintf(stderr, " -U cachefile_path -- use alternate " 116 "cachefile\n"); 117 (void) fprintf(stderr, " -R read and display block from a " 118 "device\n"); 119 (void) fprintf(stderr, " -e Pool is exported/destroyed/" 120 "has altroot\n"); 121 (void) fprintf(stderr, " -p <Path to vdev dir> (use with -e)\n"); |
122 (void) fprintf(stderr, " -t <txg> highest txg to use when " 123 "searching for uberblocks\n"); |
|
118 (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " 119 "to make only that option verbose\n"); 120 (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); 121 exit(1); 122} 123 | 124 (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " 125 "to make only that option verbose\n"); 126 (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); 127 exit(1); 128} 129 |
130/* 131 * Called for usage errors that are discovered after a call to spa_open(), 132 * dmu_bonus_hold(), or pool_match(). abort() is called for other errors. 133 */ 134 |
|
124static void 125fatal(const char *fmt, ...) 126{ 127 va_list ap; 128 129 va_start(ap, fmt); 130 (void) fprintf(stderr, "%s: ", cmdname); 131 (void) vfprintf(stderr, fmt, ap); 132 va_end(ap); 133 (void) fprintf(stderr, "\n"); 134 | 135static void 136fatal(const char *fmt, ...) 137{ 138 va_list ap; 139 140 va_start(ap, fmt); 141 (void) fprintf(stderr, "%s: ", cmdname); 142 (void) vfprintf(stderr, fmt, ap); 143 va_end(ap); 144 (void) fprintf(stderr, "\n"); 145 |
135 abort(); | 146 exit(1); |
136} 137 138static void 139dump_nvlist(nvlist_t *list, int indent) 140{ 141 nvpair_t *elem = NULL; 142 143 while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { --- 56 unchanged lines hidden (view full) --- 200/* ARGSUSED */ 201static void 202dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) 203{ 204 nvlist_t *nv; 205 size_t nvsize = *(uint64_t *)data; 206 char *packed = umem_alloc(nvsize, UMEM_NOFAIL); 207 | 147} 148 149static void 150dump_nvlist(nvlist_t *list, int indent) 151{ 152 nvpair_t *elem = NULL; 153 154 while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { --- 56 unchanged lines hidden (view full) --- 211/* ARGSUSED */ 212static void 213dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) 214{ 215 nvlist_t *nv; 216 size_t nvsize = *(uint64_t *)data; 217 char *packed = umem_alloc(nvsize, UMEM_NOFAIL); 218 |
208 VERIFY(0 == dmu_read(os, object, 0, nvsize, packed)); | 219 VERIFY(0 == dmu_read(os, object, 0, nvsize, packed, DMU_READ_PREFETCH)); |
209 210 VERIFY(nvlist_unpack(packed, nvsize, &nv, 0) == 0); 211 212 umem_free(packed, nvsize); 213 214 dump_nvlist(nv, 8); 215 216 nvlist_free(nv); --- 209 unchanged lines hidden (view full) --- 426 return; 427 428 /* 429 * Print out the freelist entries in both encoded and decoded form. 430 */ 431 alloc = 0; 432 for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { 433 VERIFY(0 == dmu_read(os, smo->smo_object, offset, | 220 221 VERIFY(nvlist_unpack(packed, nvsize, &nv, 0) == 0); 222 223 umem_free(packed, nvsize); 224 225 dump_nvlist(nv, 8); 226 227 nvlist_free(nv); --- 209 unchanged lines hidden (view full) --- 437 return; 438 439 /* 440 * Print out the freelist entries in both encoded and decoded form. 441 */ 442 alloc = 0; 443 for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { 444 VERIFY(0 == dmu_read(os, smo->smo_object, offset, |
434 sizeof (entry), &entry)); | 445 sizeof (entry), &entry, DMU_READ_PREFETCH)); |
435 if (SM_DEBUG_DECODE(entry)) { 436 (void) printf("\t\t[%4llu] %s: txg %llu, pass %llu\n", 437 (u_longlong_t)(offset / sizeof (entry)), 438 ddata[SM_DEBUG_ACTION_DECODE(entry)], 439 (u_longlong_t)SM_DEBUG_TXG_DECODE(entry), 440 (u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(entry)); 441 } else { 442 (void) printf("\t\t[%4llu] %c range:" --- 15 unchanged lines hidden (view full) --- 458 if (alloc != smo->smo_alloc) { 459 (void) printf("space_map_object alloc (%llu) INCONSISTENT " 460 "with space map summary (%llu)\n", 461 (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); 462 } 463} 464 465static void | 446 if (SM_DEBUG_DECODE(entry)) { 447 (void) printf("\t\t[%4llu] %s: txg %llu, pass %llu\n", 448 (u_longlong_t)(offset / sizeof (entry)), 449 ddata[SM_DEBUG_ACTION_DECODE(entry)], 450 (u_longlong_t)SM_DEBUG_TXG_DECODE(entry), 451 (u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(entry)); 452 } else { 453 (void) printf("\t\t[%4llu] %c range:" --- 15 unchanged lines hidden (view full) --- 469 if (alloc != smo->smo_alloc) { 470 (void) printf("space_map_object alloc (%llu) INCONSISTENT " 471 "with space map summary (%llu)\n", 472 (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); 473 } 474} 475 476static void |
477dump_metaslab_stats(metaslab_t *msp) 478{ 479 char maxbuf[5]; 480 space_map_t *sm = &msp->ms_map; 481 avl_tree_t *t = sm->sm_pp_root; 482 int free_pct = sm->sm_space * 100 / sm->sm_size; 483 484 nicenum(space_map_maxsize(sm), maxbuf); 485 486 (void) printf("\t %20s %10lu %7s %6s %4s %4d%%\n", 487 "segments", avl_numnodes(t), "maxsize", maxbuf, 488 "freepct", free_pct); 489} 490 491static void |
|
466dump_metaslab(metaslab_t *msp) 467{ 468 char freebuf[5]; 469 space_map_obj_t *smo = &msp->ms_smo; 470 vdev_t *vd = msp->ms_group->mg_vd; 471 spa_t *spa = vd->vdev_spa; 472 473 nicenum(msp->ms_map.sm_size - smo->smo_alloc, freebuf); 474 | 492dump_metaslab(metaslab_t *msp) 493{ 494 char freebuf[5]; 495 space_map_obj_t *smo = &msp->ms_smo; 496 vdev_t *vd = msp->ms_group->mg_vd; 497 spa_t *spa = vd->vdev_spa; 498 499 nicenum(msp->ms_map.sm_size - smo->smo_alloc, freebuf); 500 |
475 if (dump_opt['d'] <= 5) { 476 (void) printf("\t%10llx %10llu %5s\n", 477 (u_longlong_t)msp->ms_map.sm_start, 478 (u_longlong_t)smo->smo_object, 479 freebuf); 480 return; 481 } 482 | |
483 (void) printf( | 501 (void) printf( |
484 "\tvdev %llu offset %08llx spacemap %4llu free %5s\n", | 502 "\tvdev %5llu offset %12llx spacemap %6llu free %5s\n", |
485 (u_longlong_t)vd->vdev_id, (u_longlong_t)msp->ms_map.sm_start, 486 (u_longlong_t)smo->smo_object, freebuf); 487 | 503 (u_longlong_t)vd->vdev_id, (u_longlong_t)msp->ms_map.sm_start, 504 (u_longlong_t)smo->smo_object, freebuf); 505 |
488 ASSERT(msp->ms_map.sm_size == (1ULL << vd->vdev_ms_shift)); | 506 if (dump_opt['m'] > 1) { 507 mutex_enter(&msp->ms_lock); 508 VERIFY(space_map_load(&msp->ms_map, zfs_metaslab_ops, 509 SM_FREE, &msp->ms_smo, spa->spa_meta_objset) == 0); 510 dump_metaslab_stats(msp); 511 space_map_unload(&msp->ms_map); 512 mutex_exit(&msp->ms_lock); 513 } |
489 | 514 |
490 dump_spacemap(spa->spa_meta_objset, smo, &msp->ms_map); | 515 if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { 516 ASSERT(msp->ms_map.sm_size == (1ULL << vd->vdev_ms_shift)); 517 518 mutex_enter(&msp->ms_lock); 519 dump_spacemap(spa->spa_meta_objset, smo, &msp->ms_map); 520 mutex_exit(&msp->ms_lock); 521 } 522 |
491} 492 493static void 494dump_metaslabs(spa_t *spa) 495{ 496 vdev_t *rvd = spa->spa_root_vdev; 497 vdev_t *vd; 498 int c, m; 499 500 (void) printf("\nMetaslabs:\n"); 501 502 for (c = 0; c < rvd->vdev_children; c++) { 503 vd = rvd->vdev_child[c]; 504 | 523} 524 525static void 526dump_metaslabs(spa_t *spa) 527{ 528 vdev_t *rvd = spa->spa_root_vdev; 529 vdev_t *vd; 530 int c, m; 531 532 (void) printf("\nMetaslabs:\n"); 533 534 for (c = 0; c < rvd->vdev_children; c++) { 535 vd = rvd->vdev_child[c]; 536 |
505 (void) printf("\n vdev %llu\n\n", (u_longlong_t)vd->vdev_id); | 537 (void) printf("\t%-10s %-19s %-15s %-10s\n", 538 "vdev", "offset", "spacemap", "free"); 539 (void) printf("\t%10s %19s %15s %10s\n", 540 "----------", "-------------------", 541 "---------------", "-------------"); |
506 | 542 |
507 if (dump_opt['d'] <= 5) { 508 (void) printf("\t%10s %10s %5s\n", 509 "offset", "spacemap", "free"); 510 (void) printf("\t%10s %10s %5s\n", 511 "------", "--------", "----"); 512 } | |
513 for (m = 0; m < vd->vdev_ms_count; m++) 514 dump_metaslab(vd->vdev_ms[m]); 515 (void) printf("\n"); 516 } 517} 518 519static void | 543 for (m = 0; m < vd->vdev_ms_count; m++) 544 dump_metaslab(vd->vdev_ms[m]); 545 (void) printf("\n"); 546 } 547} 548 549static void |
550dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) 551{ 552 char *prefix = (void *)sm; 553 554 (void) printf("%s [%llu,%llu) length %llu\n", 555 prefix, 556 (u_longlong_t)start, 557 (u_longlong_t)(start + size), 558 (u_longlong_t)(size)); 559} 560 561static void |
|
520dump_dtl(vdev_t *vd, int indent) 521{ | 562dump_dtl(vdev_t *vd, int indent) 563{ |
522 avl_tree_t *t = &vd->vdev_dtl_map.sm_root; 523 space_seg_t *ss; 524 vdev_t *pvd; 525 int c; | 564 spa_t *spa = vd->vdev_spa; 565 boolean_t required; 566 char *name[DTL_TYPES] = { "missing", "partial", "scrub", "outage" }; 567 char prefix[256]; |
526 | 568 |
569 spa_vdev_state_enter(spa); 570 required = vdev_dtl_required(vd); 571 (void) spa_vdev_state_exit(spa, NULL, 0); 572 |
|
527 if (indent == 0) 528 (void) printf("\nDirty time logs:\n\n"); 529 | 573 if (indent == 0) 574 (void) printf("\nDirty time logs:\n\n"); 575 |
530 (void) printf("\t%*s%s\n", indent, "", | 576 (void) printf("\t%*s%s [%s]\n", indent, "", |
531 vd->vdev_path ? vd->vdev_path : | 577 vd->vdev_path ? vd->vdev_path : |
532 vd->vdev_parent ? vd->vdev_ops->vdev_op_type : 533 spa_name(vd->vdev_spa)); | 578 vd->vdev_parent ? vd->vdev_ops->vdev_op_type : spa_name(spa), 579 required ? "DTL-required" : "DTL-expendable"); |
534 | 580 |
535 for (ss = avl_first(t); ss; ss = AVL_NEXT(t, ss)) { 536 /* 537 * Everything in this DTL must appear in all parent DTL unions. 538 */ 539 for (pvd = vd; pvd; pvd = pvd->vdev_parent) 540 ASSERT(vdev_dtl_contains(&pvd->vdev_dtl_map, 541 ss->ss_start, ss->ss_end - ss->ss_start)); 542 (void) printf("\t%*soutage [%llu,%llu] length %llu\n", 543 indent, "", 544 (u_longlong_t)ss->ss_start, 545 (u_longlong_t)ss->ss_end - 1, 546 (u_longlong_t)(ss->ss_end - ss->ss_start)); | 581 for (int t = 0; t < DTL_TYPES; t++) { 582 space_map_t *sm = &vd->vdev_dtl[t]; 583 if (sm->sm_space == 0) 584 continue; 585 (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", 586 indent + 2, "", name[t]); 587 mutex_enter(sm->sm_lock); 588 space_map_walk(sm, dump_dtl_seg, (void *)prefix); 589 mutex_exit(sm->sm_lock); 590 if (dump_opt['d'] > 5 && vd->vdev_children == 0) 591 dump_spacemap(spa->spa_meta_objset, 592 &vd->vdev_dtl_smo, sm); |
547 } 548 | 593 } 594 |
549 (void) printf("\n"); 550 551 if (dump_opt['d'] > 5 && vd->vdev_children == 0) { 552 dump_spacemap(vd->vdev_spa->spa_meta_objset, &vd->vdev_dtl, 553 &vd->vdev_dtl_map); 554 (void) printf("\n"); 555 } 556 557 for (c = 0; c < vd->vdev_children; c++) | 595 for (int c = 0; c < vd->vdev_children; c++) |
558 dump_dtl(vd->vdev_child[c], indent + 4); 559} 560 561/*ARGSUSED*/ 562static void 563dump_dnode(objset_t *os, uint64_t object, void *data, size_t size) 564{ 565} --- 97 unchanged lines hidden (view full) --- 663 SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, 664 zb->zb_level - 1, 665 zb->zb_blkid * epb + i); 666 err = visit_indirect(spa, dnp, cbp, &czb); 667 if (err) 668 break; 669 fill += cbp->blk_fill; 670 } | 596 dump_dtl(vd->vdev_child[c], indent + 4); 597} 598 599/*ARGSUSED*/ 600static void 601dump_dnode(objset_t *os, uint64_t object, void *data, size_t size) 602{ 603} --- 97 unchanged lines hidden (view full) --- 701 SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object, 702 zb->zb_level - 1, 703 zb->zb_blkid * epb + i); 704 err = visit_indirect(spa, dnp, cbp, &czb); 705 if (err) 706 break; 707 fill += cbp->blk_fill; 708 } |
671 ASSERT3U(fill, ==, bp->blk_fill); | 709 if (!err) 710 ASSERT3U(fill, ==, bp->blk_fill); |
672 (void) arc_buf_remove_ref(buf, &buf); 673 } 674 675 return (err); 676} 677 678/*ARGSUSED*/ 679static void --- 219 unchanged lines hidden (view full) --- 899 900 /* Load domain table, if not already loaded */ 901 if (!fuid_table_loaded && (uid_idx || gid_idx)) { 902 uint64_t fuid_obj; 903 904 /* first find the fuid object. It lives in the master node */ 905 VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, 906 8, 1, &fuid_obj) == 0); | 711 (void) arc_buf_remove_ref(buf, &buf); 712 } 713 714 return (err); 715} 716 717/*ARGSUSED*/ 718static void --- 219 unchanged lines hidden (view full) --- 938 939 /* Load domain table, if not already loaded */ 940 if (!fuid_table_loaded && (uid_idx || gid_idx)) { 941 uint64_t fuid_obj; 942 943 /* first find the fuid object. It lives in the master node */ 944 VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, 945 8, 1, &fuid_obj) == 0); |
946 zfs_fuid_avl_tree_create(&idx_tree, &domain_tree); |
|
907 (void) zfs_fuid_table_load(os, fuid_obj, 908 &idx_tree, &domain_tree); 909 fuid_table_loaded = B_TRUE; 910 } 911 912 print_idstr(zp->zp_uid, "uid"); 913 print_idstr(zp->zp_gid, "gid"); 914} --- 87 unchanged lines hidden (view full) --- 1002 dump_zap, /* Pool properties */ 1003 dump_zap, /* DSL permissions */ 1004 dump_acl, /* ZFS ACL */ 1005 dump_uint8, /* ZFS SYSACL */ 1006 dump_none, /* FUID nvlist */ 1007 dump_packed_nvlist, /* FUID nvlist size */ 1008 dump_zap, /* DSL dataset next clones */ 1009 dump_zap, /* DSL scrub queue */ | 947 (void) zfs_fuid_table_load(os, fuid_obj, 948 &idx_tree, &domain_tree); 949 fuid_table_loaded = B_TRUE; 950 } 951 952 print_idstr(zp->zp_uid, "uid"); 953 print_idstr(zp->zp_gid, "gid"); 954} --- 87 unchanged lines hidden (view full) --- 1042 dump_zap, /* Pool properties */ 1043 dump_zap, /* DSL permissions */ 1044 dump_acl, /* ZFS ACL */ 1045 dump_uint8, /* ZFS SYSACL */ 1046 dump_none, /* FUID nvlist */ 1047 dump_packed_nvlist, /* FUID nvlist size */ 1048 dump_zap, /* DSL dataset next clones */ 1049 dump_zap, /* DSL scrub queue */ |
1050 dump_zap, /* ZFS user/group used */ 1051 dump_zap, /* ZFS user/group quota */ |
|
1010}; 1011 1012static void 1013dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header) 1014{ 1015 dmu_buf_t *db = NULL; 1016 dmu_object_info_t doi; 1017 dnode_t *dn; --- 47 unchanged lines hidden (view full) --- 1065 1066 if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) { 1067 (void) printf("%10s %3s %5s %5s %5s %5s %s\n", 1068 "", "", "", "", bonus_size, "bonus", 1069 dmu_ot[doi.doi_bonus_type].ot_name); 1070 } 1071 1072 if (verbosity >= 4) { | 1052}; 1053 1054static void 1055dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header) 1056{ 1057 dmu_buf_t *db = NULL; 1058 dmu_object_info_t doi; 1059 dnode_t *dn; --- 47 unchanged lines hidden (view full) --- 1107 1108 if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) { 1109 (void) printf("%10s %3s %5s %5s %5s %5s %s\n", 1110 "", "", "", "", bonus_size, "bonus", 1111 dmu_ot[doi.doi_bonus_type].ot_name); 1112 } 1113 1114 if (verbosity >= 4) { |
1115 (void) printf("\tdnode flags: %s%s\n", 1116 (dn->dn_phys->dn_flags & DNODE_FLAG_USED_BYTES) ? 1117 "USED_BYTES " : "", 1118 (dn->dn_phys->dn_flags & DNODE_FLAG_USERUSED_ACCOUNTED) ? 1119 "USERUSED_ACCOUNTED " : ""); 1120 (void) printf("\tdnode maxblkid: %llu\n", 1121 (longlong_t)dn->dn_phys->dn_maxblkid); 1122 |
|
1073 object_viewer[doi.doi_bonus_type](os, object, bonus, bsize); 1074 object_viewer[doi.doi_type](os, object, NULL, 0); 1075 *print_header = 1; 1076 } 1077 1078 if (verbosity >= 5) 1079 dump_indirect(dn); 1080 --- 38 unchanged lines hidden (view full) --- 1119 1120static void 1121dump_dir(objset_t *os) 1122{ 1123 dmu_objset_stats_t dds; 1124 uint64_t object, object_count; 1125 uint64_t refdbytes, usedobjs, scratch; 1126 char numbuf[8]; | 1123 object_viewer[doi.doi_bonus_type](os, object, bonus, bsize); 1124 object_viewer[doi.doi_type](os, object, NULL, 0); 1125 *print_header = 1; 1126 } 1127 1128 if (verbosity >= 5) 1129 dump_indirect(dn); 1130 --- 38 unchanged lines hidden (view full) --- 1169 1170static void 1171dump_dir(objset_t *os) 1172{ 1173 dmu_objset_stats_t dds; 1174 uint64_t object, object_count; 1175 uint64_t refdbytes, usedobjs, scratch; 1176 char numbuf[8]; |
1127 char blkbuf[BP_SPRINTF_LEN]; | 1177 char blkbuf[BP_SPRINTF_LEN + 20]; |
1128 char osname[MAXNAMELEN]; 1129 char *type = "UNKNOWN"; 1130 int verbosity = dump_opt['d']; 1131 int print_header = 1; 1132 int i, error; 1133 1134 dmu_objset_fast_stat(os, &dds); 1135 --- 9 unchanged lines hidden (view full) --- 1145 dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); 1146 } 1147 1148 ASSERT3U(usedobjs, ==, os->os->os_rootbp->blk_fill); 1149 1150 nicenum(refdbytes, numbuf); 1151 1152 if (verbosity >= 4) { | 1178 char osname[MAXNAMELEN]; 1179 char *type = "UNKNOWN"; 1180 int verbosity = dump_opt['d']; 1181 int print_header = 1; 1182 int i, error; 1183 1184 dmu_objset_fast_stat(os, &dds); 1185 --- 9 unchanged lines hidden (view full) --- 1195 dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); 1196 } 1197 1198 ASSERT3U(usedobjs, ==, os->os->os_rootbp->blk_fill); 1199 1200 nicenum(refdbytes, numbuf); 1201 1202 if (verbosity >= 4) { |
1153 (void) strcpy(blkbuf, ", rootbp "); 1154 sprintf_blkptr(blkbuf + strlen(blkbuf), | 1203 (void) sprintf(blkbuf + strlen(blkbuf), ", rootbp "); 1204 (void) sprintf_blkptr(blkbuf + strlen(blkbuf), |
1155 BP_SPRINTF_LEN - strlen(blkbuf), os->os->os_rootbp); 1156 } else { 1157 blkbuf[0] = '\0'; 1158 } 1159 1160 dmu_objset_name(os, osname); 1161 1162 (void) printf("Dataset %s [%s], ID %llu, cr_txg %llu, " --- 18 unchanged lines hidden (view full) --- 1181 for (i = 0; i < zopt_objects; i++) 1182 dump_object(os, zopt_object[i], verbosity, 1183 &print_header); 1184 (void) printf("\n"); 1185 return; 1186 } 1187 1188 dump_object(os, 0, verbosity, &print_header); | 1205 BP_SPRINTF_LEN - strlen(blkbuf), os->os->os_rootbp); 1206 } else { 1207 blkbuf[0] = '\0'; 1208 } 1209 1210 dmu_objset_name(os, osname); 1211 1212 (void) printf("Dataset %s [%s], ID %llu, cr_txg %llu, " --- 18 unchanged lines hidden (view full) --- 1231 for (i = 0; i < zopt_objects; i++) 1232 dump_object(os, zopt_object[i], verbosity, 1233 &print_header); 1234 (void) printf("\n"); 1235 return; 1236 } 1237 1238 dump_object(os, 0, verbosity, &print_header); |
1189 object_count = 1; | 1239 object_count = 0; 1240 if (os->os->os_userused_dnode && 1241 os->os->os_userused_dnode->dn_type != 0) { 1242 dump_object(os, DMU_USERUSED_OBJECT, verbosity, &print_header); 1243 dump_object(os, DMU_GROUPUSED_OBJECT, verbosity, &print_header); 1244 } |
1190 1191 object = 0; 1192 while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) { 1193 dump_object(os, object, verbosity, &print_header); 1194 object_count++; 1195 } 1196 1197 ASSERT3U(object_count, ==, usedobjs); 1198 1199 (void) printf("\n"); 1200 | 1245 1246 object = 0; 1247 while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) { 1248 dump_object(os, object, verbosity, &print_header); 1249 object_count++; 1250 } 1251 1252 ASSERT3U(object_count, ==, usedobjs); 1253 1254 (void) printf("\n"); 1255 |
1201 if (error != ESRCH) 1202 fatal("dmu_object_next() = %d", error); | 1256 if (error != ESRCH) { 1257 (void) fprintf(stderr, "dmu_object_next() = %d\n", error); 1258 abort(); 1259 } |
1203} 1204 1205static void 1206dump_uberblock(uberblock_t *ub) 1207{ 1208 time_t timestamp = ub->ub_timestamp; 1209 1210 (void) printf("Uberblock\n\n"); --- 174 unchanged lines hidden (view full) --- 1385{ 1386} 1387 1388static space_map_ops_t zdb_space_map_ops = { 1389 zdb_space_map_load, 1390 zdb_space_map_unload, 1391 NULL, /* alloc */ 1392 zdb_space_map_claim, | 1260} 1261 1262static void 1263dump_uberblock(uberblock_t *ub) 1264{ 1265 time_t timestamp = ub->ub_timestamp; 1266 1267 (void) printf("Uberblock\n\n"); --- 174 unchanged lines hidden (view full) --- 1442{ 1443} 1444 1445static space_map_ops_t zdb_space_map_ops = { 1446 zdb_space_map_load, 1447 zdb_space_map_unload, 1448 NULL, /* alloc */ 1449 zdb_space_map_claim, |
1393 NULL /* free */ | 1450 NULL, /* free */ 1451 NULL /* maxsize */ |
1394}; 1395 1396static void 1397zdb_leak_init(spa_t *spa) 1398{ 1399 vdev_t *rvd = spa->spa_root_vdev; 1400 1401 for (int c = 0; c < rvd->vdev_children; c++) { --- 82 unchanged lines hidden (view full) --- 1484 zio_compress_table[BP_GET_COMPRESS(bp)].ci_name, 1485 (u_longlong_t)bp->blk_cksum.zc_word[0], 1486 (u_longlong_t)bp->blk_cksum.zc_word[1], 1487 (u_longlong_t)bp->blk_cksum.zc_word[2], 1488 (u_longlong_t)bp->blk_cksum.zc_word[3]); 1489 } 1490 } 1491 | 1452}; 1453 1454static void 1455zdb_leak_init(spa_t *spa) 1456{ 1457 vdev_t *rvd = spa->spa_root_vdev; 1458 1459 for (int c = 0; c < rvd->vdev_children; c++) { --- 82 unchanged lines hidden (view full) --- 1542 zio_compress_table[BP_GET_COMPRESS(bp)].ci_name, 1543 (u_longlong_t)bp->blk_cksum.zc_word[0], 1544 (u_longlong_t)bp->blk_cksum.zc_word[1], 1545 (u_longlong_t)bp->blk_cksum.zc_word[2], 1546 (u_longlong_t)bp->blk_cksum.zc_word[3]); 1547 } 1548 } 1549 |
1492 VERIFY(zio_wait(zio_claim(NULL, spa, spa_first_txg(spa), bp, 1493 NULL, NULL, ZIO_FLAG_MUSTSUCCEED)) == 0); | 1550 if (!dump_opt['L']) 1551 VERIFY(zio_wait(zio_claim(NULL, spa, spa_first_txg(spa), bp, 1552 NULL, NULL, ZIO_FLAG_MUSTSUCCEED)) == 0); |
1494} 1495 1496static int 1497zdb_blkptr_cb(spa_t *spa, blkptr_t *bp, const zbookmark_t *zb, 1498 const dnode_phys_t *dnp, void *arg) 1499{ 1500 zdb_cb_t *zcb = arg; 1501 char blkbuf[BP_SPRINTF_LEN]; | 1553} 1554 1555static int 1556zdb_blkptr_cb(spa_t *spa, blkptr_t *bp, const zbookmark_t *zb, 1557 const dnode_phys_t *dnp, void *arg) 1558{ 1559 zdb_cb_t *zcb = arg; 1560 char blkbuf[BP_SPRINTF_LEN]; |
1561 dmu_object_type_t type; 1562 boolean_t is_l0_metadata; |
|
1502 1503 if (bp == NULL) 1504 return (0); 1505 | 1563 1564 if (bp == NULL) 1565 return (0); 1566 |
1506 zdb_count_block(spa, zcb, bp, BP_GET_TYPE(bp)); | 1567 type = BP_GET_TYPE(bp); |
1507 | 1568 |
1508 if (dump_opt['c'] || dump_opt['S']) { | 1569 zdb_count_block(spa, zcb, bp, type); 1570 1571 /* 1572 * if we do metadata-only checksumming there's no need to checksum 1573 * indirect blocks here because it is done during traverse 1574 */ 1575 is_l0_metadata = (BP_GET_LEVEL(bp) == 0 && type < DMU_OT_NUMTYPES && 1576 dmu_ot[type].ot_metadata); 1577 1578 if (dump_opt['c'] > 1 || dump_opt['S'] || 1579 (dump_opt['c'] && is_l0_metadata)) { |
1509 int ioerr, size; 1510 void *data; 1511 1512 size = BP_GET_LSIZE(bp); 1513 data = malloc(size); 1514 ioerr = zio_wait(zio_read(NULL, spa, bp, data, size, 1515 NULL, NULL, ZIO_PRIORITY_ASYNC_READ, 1516 ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB, zb)); 1517 free(data); 1518 1519 /* We expect io errors on intent log */ | 1580 int ioerr, size; 1581 void *data; 1582 1583 size = BP_GET_LSIZE(bp); 1584 data = malloc(size); 1585 ioerr = zio_wait(zio_read(NULL, spa, bp, data, size, 1586 NULL, NULL, ZIO_PRIORITY_ASYNC_READ, 1587 ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB, zb)); 1588 free(data); 1589 1590 /* We expect io errors on intent log */ |
1520 if (ioerr && BP_GET_TYPE(bp) != DMU_OT_INTENT_LOG) { | 1591 if (ioerr && type != DMU_OT_INTENT_LOG) { |
1521 zcb->zcb_haderrors = 1; 1522 zcb->zcb_errors[ioerr]++; 1523 1524 if (dump_opt['b'] >= 2) 1525 sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, bp); 1526 else 1527 blkbuf[0] = '\0'; 1528 --- 31 unchanged lines hidden (view full) --- 1560 zdb_cb_t zcb = { 0 }; 1561 zdb_blkstats_t *zb, *tzb; 1562 uint64_t alloc, space, logalloc; 1563 vdev_t *rvd = spa->spa_root_vdev; 1564 int leaks = 0; 1565 int c, e; 1566 1567 if (!dump_opt['S']) { | 1592 zcb->zcb_haderrors = 1; 1593 zcb->zcb_errors[ioerr]++; 1594 1595 if (dump_opt['b'] >= 2) 1596 sprintf_blkptr(blkbuf, BP_SPRINTF_LEN, bp); 1597 else 1598 blkbuf[0] = '\0'; 1599 --- 31 unchanged lines hidden (view full) --- 1631 zdb_cb_t zcb = { 0 }; 1632 zdb_blkstats_t *zb, *tzb; 1633 uint64_t alloc, space, logalloc; 1634 vdev_t *rvd = spa->spa_root_vdev; 1635 int leaks = 0; 1636 int c, e; 1637 1638 if (!dump_opt['S']) { |
1568 (void) printf("\nTraversing all blocks to %sverify" 1569 " nothing leaked ...\n", 1570 dump_opt['c'] ? "verify checksums and " : ""); | 1639 (void) printf("\nTraversing all blocks %s%s%s%s%s...\n", 1640 (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "", 1641 (dump_opt['c'] == 1) ? "metadata " : "", 1642 dump_opt['c'] ? "checksums " : "", 1643 (dump_opt['c'] && !dump_opt['L']) ? "and verify " : "", 1644 !dump_opt['L'] ? "nothing leaked " : ""); |
1571 } 1572 1573 /* 1574 * Load all space maps as SM_ALLOC maps, then traverse the pool 1575 * claiming each block we discover. If the pool is perfectly 1576 * consistent, the space maps will be empty when we're done. 1577 * Anything left over is a leak; any block we can't claim (because 1578 * it's not part of any space map) is a double allocation, 1579 * reference to a freed block, or an unclaimed log block. 1580 */ | 1645 } 1646 1647 /* 1648 * Load all space maps as SM_ALLOC maps, then traverse the pool 1649 * claiming each block we discover. If the pool is perfectly 1650 * consistent, the space maps will be empty when we're done. 1651 * Anything left over is a leak; any block we can't claim (because 1652 * it's not part of any space map) is a double allocation, 1653 * reference to a freed block, or an unclaimed log block. 1654 */ |
1581 zdb_leak_init(spa); | 1655 if (!dump_opt['L']) 1656 zdb_leak_init(spa); |
1582 1583 /* 1584 * If there's a deferred-free bplist, process that first. 1585 */ 1586 if (spa->spa_sync_bplist_obj != 0) { 1587 bplist_t *bpl = &spa->spa_sync_bplist; 1588 blkptr_t blk; 1589 uint64_t itor = 0; --- 25 unchanged lines hidden (view full) --- 1615 e, (u_longlong_t)zcb.zcb_errors[e]); 1616 } 1617 } 1618 } 1619 1620 /* 1621 * Report any leaked segments. 1622 */ | 1657 1658 /* 1659 * If there's a deferred-free bplist, process that first. 1660 */ 1661 if (spa->spa_sync_bplist_obj != 0) { 1662 bplist_t *bpl = &spa->spa_sync_bplist; 1663 blkptr_t blk; 1664 uint64_t itor = 0; --- 25 unchanged lines hidden (view full) --- 1690 e, (u_longlong_t)zcb.zcb_errors[e]); 1691 } 1692 } 1693 } 1694 1695 /* 1696 * Report any leaked segments. 1697 */ |
1623 zdb_leak_fini(spa); | 1698 if (!dump_opt['L']) 1699 zdb_leak_fini(spa); |
1624 1625 /* 1626 * If we're interested in printing out the blkptr signatures, 1627 * return now as we don't print out anything else (including 1628 * errors and leaks). 1629 */ 1630 if (dump_opt['S']) 1631 return (zcb.zcb_haderrors ? 3 : 0); --- 9 unchanged lines hidden (view full) --- 1641 1642 for (c = 0; c < rvd->vdev_children; c++) 1643 if (rvd->vdev_child[c]->vdev_islog) 1644 logalloc += rvd->vdev_child[c]->vdev_stat.vs_alloc; 1645 1646 tzb = &zcb.zcb_type[ZB_TOTAL][DMU_OT_TOTAL]; 1647 1648 if (tzb->zb_asize == alloc + logalloc) { | 1700 1701 /* 1702 * If we're interested in printing out the blkptr signatures, 1703 * return now as we don't print out anything else (including 1704 * errors and leaks). 1705 */ 1706 if (dump_opt['S']) 1707 return (zcb.zcb_haderrors ? 3 : 0); --- 9 unchanged lines hidden (view full) --- 1717 1718 for (c = 0; c < rvd->vdev_children; c++) 1719 if (rvd->vdev_child[c]->vdev_islog) 1720 logalloc += rvd->vdev_child[c]->vdev_stat.vs_alloc; 1721 1722 tzb = &zcb.zcb_type[ZB_TOTAL][DMU_OT_TOTAL]; 1723 1724 if (tzb->zb_asize == alloc + logalloc) { |
1649 (void) printf("\n\tNo leaks (block sum matches space" 1650 " maps exactly)\n"); | 1725 if (!dump_opt['L']) 1726 (void) printf("\n\tNo leaks (block sum matches space" 1727 " maps exactly)\n"); |
1651 } else { 1652 (void) printf("block traversal size %llu != alloc %llu " | 1728 } else { 1729 (void) printf("block traversal size %llu != alloc %llu " |
1653 "(leaked %lld)\n", | 1730 "(%s %lld)\n", |
1654 (u_longlong_t)tzb->zb_asize, 1655 (u_longlong_t)alloc + logalloc, | 1731 (u_longlong_t)tzb->zb_asize, 1732 (u_longlong_t)alloc + logalloc, |
1656 (u_longlong_t)(alloc + logalloc - tzb->zb_asize)); | 1733 (dump_opt['L']) ? "unreachable" : "leaked", 1734 (longlong_t)(alloc + logalloc - tzb->zb_asize)); |
1657 leaks = 1; 1658 } 1659 1660 if (tzb->zb_count == 0) 1661 return (2); 1662 1663 (void) printf("\n"); 1664 (void) printf("\tbp count: %10llu\n", --- 90 unchanged lines hidden (view full) --- 1755dump_zpool(spa_t *spa) 1756{ 1757 dsl_pool_t *dp = spa_get_dsl(spa); 1758 int rc = 0; 1759 1760 if (dump_opt['u']) 1761 dump_uberblock(&spa->spa_uberblock); 1762 | 1735 leaks = 1; 1736 } 1737 1738 if (tzb->zb_count == 0) 1739 return (2); 1740 1741 (void) printf("\n"); 1742 (void) printf("\tbp count: %10llu\n", --- 90 unchanged lines hidden (view full) --- 1833dump_zpool(spa_t *spa) 1834{ 1835 dsl_pool_t *dp = spa_get_dsl(spa); 1836 int rc = 0; 1837 1838 if (dump_opt['u']) 1839 dump_uberblock(&spa->spa_uberblock); 1840 |
1763 if (dump_opt['d'] || dump_opt['i']) { | 1841 if (dump_opt['d'] || dump_opt['i'] || dump_opt['m']) { |
1764 dump_dir(dp->dp_meta_objset); 1765 if (dump_opt['d'] >= 3) { 1766 dump_bplist(dp->dp_meta_objset, 1767 spa->spa_sync_bplist_obj, "Deferred frees"); 1768 dump_dtl(spa->spa_root_vdev, 0); | 1842 dump_dir(dp->dp_meta_objset); 1843 if (dump_opt['d'] >= 3) { 1844 dump_bplist(dp->dp_meta_objset, 1845 spa->spa_sync_bplist_obj, "Deferred frees"); 1846 dump_dtl(spa->spa_root_vdev, 0); |
1769 dump_metaslabs(spa); | |
1770 } | 1847 } |
1848 1849 if (dump_opt['d'] >= 3 || dump_opt['m']) 1850 dump_metaslabs(spa); 1851 |
|
1771 (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, 1772 DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); 1773 } 1774 1775 if (dump_opt['b'] || dump_opt['c'] || dump_opt['S']) 1776 rc = dump_block_stats(spa); 1777 1778 if (dump_opt['s']) --- 459 unchanged lines hidden (view full) --- 2238 int exported = 0; 2239 char *vdev_dir = NULL; 2240 2241 (void) setrlimit(RLIMIT_NOFILE, &rl); 2242 (void) enable_extended_FILE_stdio(-1, -1); 2243 2244 dprintf_setup(&argc, argv); 2245 | 1852 (void) dmu_objset_find(spa_name(spa), dump_one_dir, NULL, 1853 DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN); 1854 } 1855 1856 if (dump_opt['b'] || dump_opt['c'] || dump_opt['S']) 1857 rc = dump_block_stats(spa); 1858 1859 if (dump_opt['s']) --- 459 unchanged lines hidden (view full) --- 2319 int exported = 0; 2320 char *vdev_dir = NULL; 2321 2322 (void) setrlimit(RLIMIT_NOFILE, &rl); 2323 (void) enable_extended_FILE_stdio(-1, -1); 2324 2325 dprintf_setup(&argc, argv); 2326 |
2246 while ((c = getopt(argc, argv, "udibcsvCS:U:lRep:")) != -1) { | 2327 while ((c = getopt(argc, argv, "udibcmsvCLS:U:lRep:t:")) != -1) { |
2247 switch (c) { 2248 case 'u': 2249 case 'd': 2250 case 'i': 2251 case 'b': 2252 case 'c': | 2328 switch (c) { 2329 case 'u': 2330 case 'd': 2331 case 'i': 2332 case 'b': 2333 case 'c': |
2334 case 'm': |
|
2253 case 's': 2254 case 'C': 2255 case 'l': 2256 case 'R': 2257 dump_opt[c]++; 2258 dump_all = 0; 2259 break; | 2335 case 's': 2336 case 'C': 2337 case 'l': 2338 case 'R': 2339 dump_opt[c]++; 2340 dump_all = 0; 2341 break; |
2342 case 'L': 2343 dump_opt[c]++; 2344 break; |
|
2260 case 'v': 2261 verbose++; 2262 break; 2263 case 'U': 2264 spa_config_path = optarg; 2265 break; 2266 case 'e': 2267 exported = 1; --- 14 unchanged lines hidden (view full) --- 2282 zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_4; 2283 else if (strcmp(endstr, "sha256") == 0) 2284 zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; 2285 else if (strcmp(endstr, "all") == 0) 2286 zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_2; 2287 else 2288 usage(); 2289 break; | 2345 case 'v': 2346 verbose++; 2347 break; 2348 case 'U': 2349 spa_config_path = optarg; 2350 break; 2351 case 'e': 2352 exported = 1; --- 14 unchanged lines hidden (view full) --- 2367 zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_4; 2368 else if (strcmp(endstr, "sha256") == 0) 2369 zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; 2370 else if (strcmp(endstr, "all") == 0) 2371 zdb_sig_cksumalg = ZIO_CHECKSUM_FLETCHER_2; 2372 else 2373 usage(); 2374 break; |
2375 case 't': 2376 ub_max_txg = strtoull(optarg, NULL, 0); 2377 if (ub_max_txg < TXG_INITIAL) { 2378 (void) fprintf(stderr, "incorrect txg " 2379 "specified: %s\n", optarg); 2380 usage(); 2381 } 2382 break; |
|
2290 default: 2291 usage(); 2292 break; 2293 } 2294 } 2295 2296 if (vdev_dir != NULL && exported == 0) { 2297 (void) fprintf(stderr, "-p option requires use of -e\n"); --- 71 unchanged lines hidden (view full) --- 2369 error = ENOMEM; 2370 else if (nvlist_add_string(nvl, 2371 zpool_prop_to_name(ZPOOL_PROP_ALTROOT), 2372 vdev_dir) != 0) 2373 error = ENOMEM; 2374 } 2375 2376 if (error == 0) | 2383 default: 2384 usage(); 2385 break; 2386 } 2387 } 2388 2389 if (vdev_dir != NULL && exported == 0) { 2390 (void) fprintf(stderr, "-p option requires use of -e\n"); --- 71 unchanged lines hidden (view full) --- 2462 error = ENOMEM; 2463 else if (nvlist_add_string(nvl, 2464 zpool_prop_to_name(ZPOOL_PROP_ALTROOT), 2465 vdev_dir) != 0) 2466 error = ENOMEM; 2467 } 2468 2469 if (error == 0) |
2377 error = spa_import_faulted(argv[0], | 2470 error = spa_import_verbatim(argv[0], |
2378 exported_conf, nvl); 2379 2380 nvlist_free(nvl); 2381 } 2382 2383 if (slash != NULL) 2384 *slash = '/'; 2385 } --- 41 unchanged lines hidden --- | 2471 exported_conf, nvl); 2472 2473 nvlist_free(nvl); 2474 } 2475 2476 if (slash != NULL) 2477 *slash = '/'; 2478 } --- 41 unchanged lines hidden --- |