Skip to content

Don't try to get mg of hole vdev in removal #17080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 25, 2025
Merged

Conversation

pcd1193182
Copy link
Contributor

Motivation and Context

When doing device removal, we verify that the vdev being removed isn't the last vdev in the normal class. To do that, we iterate over all the disks and checking their metaslab class until we find one in the normal group. Right now, if you have a hole vdev before the first allocatable normal class vdev, we kernel panic.

Description

Add a check for hole vdevs to the passivate code.

How Has This Been Tested?

Added a new test to the test suite and verified that it passes. Without the change, it fails.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

@pcd1193182 pcd1193182 requested a review from allanjude February 21, 2025 19:24
Copy link
Member

@amotin amotin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if vdev_is_concrete(cvd) would be cleaner. May be in combination with && !vdev_is_dead(cvd).

Paul Dagnelie added 2 commits February 24, 2025 09:21
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.

Signed-off-by: Paul Dagnelie <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
@amotin amotin added the Status: Code Review Needed Ready for review and testing label Feb 24, 2025
@amotin amotin added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Feb 25, 2025
@amotin amotin merged commit 701093c into openzfs:master Feb 25, 2025
22 of 25 checks passed
ixhamza pushed a commit to truenas/zfs that referenced this pull request Feb 25, 2025
Don't try to get mg of hole vdev in removal

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#17080
ixhamza pushed a commit to ixhamza/zfs that referenced this pull request Feb 27, 2025
Don't try to get mg of hole vdev in removal

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Paul Dagnelie <[email protected]>
Closes openzfs#17080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants