]> git.proxmox.com Git - mirror_zfs.git/commit
ZTS: Fix list_file_blocks for mirror vdevs, level > 0
authorRyan Moeller <ryan@iXsystems.com>
Wed, 28 Oct 2020 20:29:31 +0000 (20:29 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 6 Nov 2020 01:16:16 +0000 (17:16 -0800)
commit94deb47872e1fd6cf460eddf119bd219bcb30a27
tree9c6b1dde973b6e81024e3cdc5813ffac9e7f7ae7
parentae37ceadaa2a8cf09fbf1a9baafaa6dc6e24318a
ZTS: Fix list_file_blocks for mirror vdevs, level > 0

The first part of list_file_blocks transforms the pool configuration
output by zdb -C $pool into shell code to set up a shell variable,
VDEV_MAP, that maps from vdev id to the underlying vdev path. This
variable is a simple indexed array. However, the vdev id in a DVA is
only the id of the top level vdev.

When the pool is mirrored, the top level vdev is a mirror and its
children are the mirrored devices. So, what we need is to map from
the top level vdev id to a list of the underlying vdev paths.
ist_file_blocks does not need to work for raidz vdevs, so we can
disregard that case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11141
tests/zfs-tests/include/blkdev.shlib