diff options
author | Brian Behlendorf <[email protected]> | 2022-04-28 16:47:12 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2022-04-28 16:47:12 -0700 |
commit | ce8d41ef75e1667710a5aeb393877c7ed4b34576 (patch) | |
tree | fd603d81c5b117f01d57619f77220ae598861712 /cmd | |
parent | c0ff5f156070bd815bea811b8fd97ad1a78edd6d (diff) |
Skip spacemaps reading in case of pool readonly import
The only zdb utility require to read metaslab-related data during
read-only pool import because of spacemaps validation. Add global
variable which will allow zdb read spacemaps in case of readonly
import mode.
Reviewed-by: Serapheim Dimitropoulos <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Fedor Uporov <[email protected]>
Closes #9095
Closes #12687
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zdb/zdb.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 9de41cef2..75688205f 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -110,6 +110,7 @@ extern int zfs_recover; extern unsigned long zfs_arc_meta_min, zfs_arc_meta_limit; extern int zfs_vdev_async_read_max_active; extern boolean_t spa_load_verify_dryrun; +extern boolean_t spa_mode_readable_spacemaps; extern int zfs_reconstruct_indirect_combinations_max; extern int zfs_btree_verify_intensity; @@ -8469,6 +8470,11 @@ main(int argc, char **argv) */ spa_load_verify_dryrun = B_TRUE; + /* + * ZDB should have ability to read spacemaps. + */ + spa_mode_readable_spacemaps = B_TRUE; + kernel_init(SPA_MODE_READ); if (dump_all) |