HomeFreeBSD

vdev_ops: don't try to call vdev_op_hold or vdev_op_rele when NULL

Description

vdev_ops: don't try to call vdev_op_hold or vdev_op_rele when NULL

This prevents a panic after a SLOG add/removal on the root pool followed
by a zpool scrub.

When a SLOG is removed, a hole takes its place - the vdev_ops for a hole
is vdev_hole_ops, which defines the handler functions of vdev_op_hold
and vdev_op_rele as NULL.

This bug has been reported in illumos and FreeBSD, a different trigger
in the FreeBSD report though.

Credit for this patch goes to Patrick Mooney <pmooney@pfmooney.com>

Obtained from: illumos-gate commit: c65bd18728f34725
External-issue: https://www.illumos.org/issues/12981
External-issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252396
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Wing <rob.fx907@gmail.com>
Closes #11623

Details

Provenance
fbynite <52733326+fbynite@users.noreply.github.com>Authored on Feb 21 2021, 4:19 AM
GitHub <noreply@github.com>Committed on Feb 21 2021, 4:19 AM
Parents
rG7e56b05058c8: Better zfs_get_enclosure_sysfs_path() enclosure support
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG11f2e9a491ba: vdev_ops: don't try to call vdev_op_hold or vdev_op_rele when NULL (authored by fbynite <52733326+fbynite@users.noreply.github.com>).Feb 21 2021, 4:19 AM