Skip to content
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

Don't panic if setting vdev properties is unsupported for this vdev type #15063

Merged
merged 1 commit into from Jul 20, 2023
Merged

Don't panic if setting vdev properties is unsupported for this vdev type #15063

merged 1 commit into from Jul 20, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jul 13, 2023

Return EINVAL instead of panicking if vdev does not support setting vdev properties.

Motivation and Context

Panicking is a really bad way of communicating to user that this vdev type does not support setting vdev properties.

Description

Check that vdev has valid zap and bail out early.

While here, move objid selection out of the loop, it's not going to change.

How Has This Been Tested?

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:

Check that vdev has valid zap and bail out early.

While here, move objid selection out of the loop, it's not going to
change.

Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Copy link
Contributor

@allanjude allanjude left a comment

Choose a reason for hiding this comment

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

Reviewed-By: Allan Jude <allan@klarasystems.com>

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jul 20, 2023
@behlendorf behlendorf merged commit 929173a into openzfs:master Jul 20, 2023
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Jul 21, 2023
Check that vdev has valid zap and bail out early.

While here, move objid selection out of the loop, it's not going to
change.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Closes openzfs#15063
behlendorf pushed a commit that referenced this pull request Jul 21, 2023
Check that vdev has valid zap and bail out early.

While here, move objid selection out of the loop, it's not going to
change.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Closes #15063
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Dec 12, 2023
Check that vdev has valid zap and bail out early.

While here, move objid selection out of the loop, it's not going to
change.

Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Yuri Pankov <yuripv@FreeBSD.org>
Closes openzfs#15063
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.

2 participants