vdev_ops: don't try to call vdev_op_hold or vdev_op_rele when NULL #11623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Signed-off-by: Rob Wing rob.fx907@gmail.com
Motivation and Context
Prevent panic after doing a SLOG add/removal followed by a zpool scrub
Credit for this patch goes to Patrick Mooney, he also has a detailed report of this bug that can be found in the illumos link below.
A couple reports point to this bug (triggered in different ways):
https://www.illumos.org/issues/12981
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252396
Description
don't de-reference vdev_op_hold or vdev_op_rele when NULL
How Has This Been Tested?
zpool add zroot log vdev
zpool remove zroot vdev
zpool scrub
result: did not panic
Types of changes
Checklist:
Signed-off-by
.