HomeFreeBSD

zdb: Fix zdb '-O|-r' options with -e/exported zpool

Description

zdb: Fix zdb '-O|-r' options with -e/exported zpool

zdb with '-e' or exported zpool doesn't work along with
'-O' and '-r' options as we process them before '-e' has
been processed.

Below errors are seen:

~> zdb -e pool-mds65/mdt65 -O oi.9/0x200000009:0x0:0x0
failed to hold dataset 'pool-mds65/mdt65': No such file or directory

~> zdb -e pool-oss0/ost0 -r file1 /tmp/filecopy1 -p.
failed to hold dataset 'pool-oss0/ost0': No such file or directory
zdb: internal error: No such file or directory

We need to make sure to process '-O|-r' options after the
'-e' option has been processed, which imports the pool to
the namespace if it's not in the cachefile.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Akash B <akash-b@hpe.com>
Closes #15532

Details

Provenance
Akash B <akash-b@hpe.com>Authored on Nov 27 2023, 9:41 PM
GitHub <noreply@github.com>Committed on Nov 27 2023, 9:41 PM
Parents
rG213d6829673c: zdb: show BRT statistics and dump its contents
Branches
Unknown
Tags
Unknown