]> git.proxmox.com Git - mirror_zfs.git/commit
Fix error handling of vdev_top_zap
authorMatthew Ahrens <matthew.ahrens@delphix.com>
Thu, 30 Jul 2020 00:04:34 +0000 (17:04 -0700)
committerGitHub <noreply@github.com>
Thu, 30 Jul 2020 00:04:34 +0000 (17:04 -0700)
commit3a92552f755543c02c71aa29d680261907b1bea3
tree410926fec2dc776b335d73b09ab75d7a37514545
parentae12b023082fd91e89507a2a1fc014e64c6767f0
Fix error handling of vdev_top_zap

In `vdev_load()`, we look up several entries in the `vdev_top_zap`
object.  In most cases, if we encounter an i/o error, it will be
returned to the caller.  However, when handling
`VDEV_TOP_ZAP_ALLOCATION_BIAS`, if we get an i/o error, we may continue
on, which in theory could cause us to not realize that a vdev should be
used only for `special` allocations.

In practice, if we encountered an i/o error while looking for
`VDEV_TOP_ZAP_ALLOCATION_BIAS` in the `vdev_top_zap`, we'd also get an
i/o error while looking for other entries in the same object, and thus
the zpool open/import would fail.  Therefore the impact of this problem
is negligible.

This commit adds error handling for i/o errors while accessing the
`vdev_top_zap`, so that we aren't relying on unrelated code to fail for
us.

Reviewed-by: Don Brady <don.brady@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #10637
module/zfs/vdev.c