mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
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 <serapheim@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com> Closes #9095 Closes #12687
This commit is contained in:
@@ -3142,6 +3142,12 @@ vdev_dtl_load(vdev_t *vd)
|
||||
if (vd->vdev_ops->vdev_op_leaf && vd->vdev_dtl_object != 0) {
|
||||
ASSERT(vdev_is_concrete(vd));
|
||||
|
||||
/*
|
||||
* If the dtl cannot be sync'd there is no need to open it.
|
||||
*/
|
||||
if (spa->spa_mode == SPA_MODE_READ && !spa->spa_read_spacemaps)
|
||||
return (0);
|
||||
|
||||
error = space_map_open(&vd->vdev_dtl_sm, mos,
|
||||
vd->vdev_dtl_object, 0, -1ULL, 0);
|
||||
if (error)
|
||||
|
||||
Reference in New Issue
Block a user