diff options
author | Alexander Motin <mav@FreeBSD.org> | 2018-02-22 00:42:12 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2018-02-22 00:42:12 +0000 |
commit | 502d18a8f1875ce6bd175e6c46e7c125e0e1847e (patch) | |
tree | a474ebfba85d13520c73de37df229bf500ea1cbc /cddl/contrib/opensolaris/cmd/zdb/zdb.c | |
parent | 4f8666989a25fdd997e987981c3f8a5440f5fa8a (diff) | |
parent | 38fc65e02783418319af282674409119a60ec6c5 (diff) | |
download | src-502d18a8f1875ce6bd175e6c46e7c125e0e1847e.tar.gz src-502d18a8f1875ce6bd175e6c46e7c125e0e1847e.zip |
MFV r329766: 8962 zdb should work on non-idle pools
illumos/illumos-gate@e144c4e6c90e7d4dccaad6db660ee42b6e7ba04f
Currently `zdb` consistently fails to examine non-idle pools as it fails
during the `spa_load()` process. The main problem seems to be that
`spa_load_verify()` fails as can be seen below:
$ sudo zdb -d -G dcenter
zdb: can't open 'dcenter': I/O error
ZFS_DBGMSG(zdb):
spa_open_common: opening dcenter
spa_load(dcenter): LOADING
disk vdev '/dev/dsk/c4t11d0s0': best uberblock found for spa dcenter. txg 40824950
spa_load(dcenter): using uberblock with txg=40824950
spa_load(dcenter): UNLOADING
spa_load(dcenter): RELOADING
spa_load(dcenter): LOADING
disk vdev '/dev/dsk/c3t10d0s0': best uberblock found for spa dcenter. txg 40824952
spa_load(dcenter): using uberblock with txg=40824952
spa_load(dcenter): FAILED: spa_load_verify failed [error=5]
spa_load(dcenter): UNLOADING
This change makes `spa_load_verify()` a dryrun when ran from `zdb`. This is
done by creating a global flag in zfs and then setting it in `zdb`.
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
Notes
Notes:
svn path=/head/; revision=329769
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zdb/zdb.c')
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zdb/zdb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zdb/zdb.c b/cddl/contrib/opensolaris/cmd/zdb/zdb.c index 41afcd0c90bf..fd96078d141c 100644 --- a/cddl/contrib/opensolaris/cmd/zdb/zdb.c +++ b/cddl/contrib/opensolaris/cmd/zdb/zdb.c @@ -87,11 +87,13 @@ extern int reference_tracking_enable; extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; extern int zfs_vdev_async_read_max_active; +extern boolean_t spa_load_verify_dryrun; #else int reference_tracking_enable; boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; int zfs_vdev_async_read_max_active; +boolean_t spa_load_verify_dryrun; #endif static const char cmdname[] = "zdb"; @@ -4578,6 +4580,12 @@ main(int argc, char **argv) */ reference_tracking_enable = B_FALSE; + /* + * Do not fail spa_load when spa_load_verify fails. This is needed + * to load non-idle pools. + */ + spa_load_verify_dryrun = B_TRUE; + kernel_init(FREAD); g_zfs = libzfs_init(); if (g_zfs == NULL) |