Avoid some crashes when importing a pool with corrupt metadata
commitd5c97f3de7ac3d5568bc641cc87a2edf37f8b9b5
authorSteve Mokris <smokris@softpixel.com>
Thu, 26 Dec 2019 18:57:05 +0000 (26 13:57 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 26 Dec 2019 18:57:05 +0000 (26 10:57 -0800)
tree330a3cf03dcf5487bff48d95cb3a42c6e8e29f87
parentad353e214798619ef4244f84325eb48d8b1afdab
Avoid some crashes when importing a pool with corrupt metadata

- Skip invalid DVAs when importing pools in readonly mode
  (in addition to when the config is untrusted).

- Upon encountering a DVA with a null VDEV, fail gracefully
  instead of panicking with a NULL pointer dereference.

Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Steve Mokris <smokris@softpixel.com>
Closes #9022
module/zfs/vdev_mirror.c