]> git.proxmox.com Git - mirror_zfs.git/commit
OpenZFS 8962 - zdb should work on non-idle pools
authorPavel Zakharov <pavel.zakharov@delphix.com>
Tue, 30 Jan 2018 23:25:19 +0000 (15:25 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 9 May 2018 04:32:57 +0000 (21:32 -0700)
commitafd2f7b7117ff8bf23afa70ecae86ec0c1a1461e
tree8fddf0716343396ff777a66063f7078e6552f509
parent4a0ee12af8967a859c3607530aaef466e21cebc3
OpenZFS 8962 - zdb should work on non-idle pools

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`.

Authored by: Pavel Zakharov <pavel.zakharov@delphix.com>
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>
Ported-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Tim Chase <tim@chase2k.com>
OpenZFS-issue: https://illumos.org/issues/8962
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/180ad792
Closes #7459
cmd/zdb/zdb.c
module/zfs/spa.c