-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 attempt trimming "hole" vdevs #10227
Conversation
On zpools containig hole vdevs (e.g. removed log devices), the `zpool trim` (and presumably `zpool initialize`) commands will attempt calling their respective functions on "hole", which fails, as this is not a real vdev. Avoid this by removing HOLE vdevs in zpool_collect_leaves. Signed-off-by: Niklas Haas <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #10227 +/- ##
==========================================
- Coverage 79.48% 79.25% -0.24%
==========================================
Files 388 388
Lines 123390 123391 +1
==========================================
- Hits 98077 97791 -286
- Misses 25313 25600 +287
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks for catching this.
On zpools containing hole vdevs (e.g. removed log devices), the `zpool trim` (and presumably `zpool initialize`) commands will attempt calling their respective functions on "hole", which fails, as this is not a real vdev. Avoid this by removing HOLE vdevs in zpool_collect_leaves. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Niklas Haas <[email protected]> Closes openzfs#10227 (cherry picked from commit a84c92f)
On zpools containing hole vdevs (e.g. removed log devices), the `zpool trim` (and presumably `zpool initialize`) commands will attempt calling their respective functions on "hole", which fails, as this is not a real vdev. Avoid this by removing HOLE vdevs in zpool_collect_leaves. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Niklas Haas <[email protected]> Closes openzfs#10227
Motivation and Context
I noticed that my
zpool trim <poolname>
command fails with:I've never seen such
"hole"
devices before, but I suspect the reason I have one now was that I added and removed a log device for testing purposes. (One of the commends inzpool_vdev.c
suggests something similar: that"hole"
represents added and removed aux devices)Obviously a command like
zpool trim
should therefore ignore hole devices.Description
The easiest place to make this change is in
zpool_collect_leaves
. This has only one other user (zpool initialize
), which I therefore assume has the same bug.How Has This Been Tested?
I rebuilt
zpool
and ranzpool trim
on my pool, which worked successfully. I have not tested the effects of the change onzpool initialize
.Types of changes
Checklist:
Signed-off-by
.