-
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
Rescan enclosure sysfs path on import #12095
Conversation
5abff7a
to
d352a62
Compare
Tested d352a62 on a pool with wrong vdev_enc_sysfs_path vdev_enc_sysfs_path corrected?
|
@tonyhutter This patch does indeed improve the situation, an exported pool with incorrect enclosure path gets the right one after import. Also, creating a new pool gets the enclosure path set now. I haven't been able to test with enclosure path changing between reboots, but the results of @nscfreny seems to show there's work to be done still... I'll be on site monday and try anyway, making our enclosure device move is a simple as removing a few disks from the enclosure and reboot. |
IMO, the ZPOOL_CONFIG_VDEV_ENCPATH_OVERRIDE could be made part of the patch together with some tests to avoid regressions in this area. At least some basics could be covered without requiring actual enclosure hardware. Something along the lines of:
And build on scenarios from there. A reboot or equivalent should clear/change the enclosure path of disk2 depending on hardware. export followed by import with ZPOOL_CONFIG_VDEV_ENCPATH_OVERRIDE set should have the enclosure path set to the override, etc. This could then be improved on to encompass zed related tests by doing:
to get the LED entries in place. We can then trigger various states for disk2 and verify that zed-stuff flips the led entries as appropriate. Your thoughts? |
We have a spare HPE Apollo 4510 with a few disks in it and since it has a smartpqi controller, vdev_enc_sysfs_path will be offset by one if I create a logical volume on one of the drives and reboot. Unfortunately I'll be in zoom meetings rest of the day but I can probably do some testing during the weekend. |
I think may have a lead on why reboot/import-cache does not correct wrong vdev_enc_sysfs_path in vdev_copy_path_impl().
Edit: A temporary workaround for import-cache could be to have zfs-import-cache.service run a script that extract pool names from zpool.cache, remove zpool.cache and import pools by name. |
Thanks, I forgot to test with a cache. I'll see if I can find a perminant fix for that case and add it to this PR. |
The only case I can think of when using an encpath from the cache could be useful would be for MISSING/UNAVAILABLE devices, if it's valid that is. |
Discovered that if vdev_path from zpool.cache does not match reality after reboot, vdev_enc_sysfs_path will also be corrected on import retry. This will of course not work with WWN id device names that does not change, but vdev_enc_sysfs_path can still be messed up by disks missing after reboot. Here I cheated by editing zpool.cache to look like it would have if a disk with a lower slot number had "ceased to exist" after reboot (scary error message considering retry was successful).
|
So it looks like a cache import is a different codepath that doesn't call
I'm looking into the cleanest way of doing that. |
I believe See near: |
@nscfreny that kind of defeats the purpose of doing a cache import though. You also can't pass both |
@tonyhutter a cache import that fail because a device path has changed will automatically retry with |
I think that's true for the common case. But if you create your pool with |
28819b4
to
493807c
Compare
This is having build errors on Ubuntu/Debian. I need to look into those... |
93e077a
to
eb6f849
Compare
Looks like there's some API stuff I need to update:
|
4902c11
to
b6f685d
Compare
The ZTS failures are from a NULL pointer dereference kernel panic. I'm looking into that... |
b6f685d
to
9cbb09d
Compare
70c3e7e
to
dc7a05d
Compare
The checkstyle failure is a known issue (#12459) |
32070a3
to
61154dc
Compare
I think these failures are unrelated to this PR. Reviewers - please take another look. |
c3abcdb
to
c9f9a0e
Compare
c9f9a0e
to
6e99ea8
Compare
My latest push gets rid of the ABI changes and is correctly building again on FreeBSD. Reviewers, please take another look when you get a chance. |
6e99ea8
to
2c6f34c
Compare
My latest push reworkes this code again to be even more simplified. |
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.
Thanks for further rework, this looks good to me and turned out nicely.
When you create a pool, zfs writes vd->vdev_enc_sysfs_path with the enclosure sysfs path to the fault LEDs, like: vdev_enc_sysfs_path = /sys/class/enclosure/0:0:1:0/SLOT8 However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue. Signed-off-by: Tony Hutter <hutter2@llnl.gov>
2c6f34c
to
1aca2b4
Compare
When you create a pool, zfs writes vd->vdev_enc_sysfs_path with the enclosure sysfs path to the fault LEDs, like: vdev_enc_sysfs_path = /sys/class/enclosure/0:0:1:0/SLOT8 However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#11950 Closes openzfs#12095
When you create a pool, zfs writes vd->vdev_enc_sysfs_path with the enclosure sysfs path to the fault LEDs, like: vdev_enc_sysfs_path = /sys/class/enclosure/0:0:1:0/SLOT8 However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#11950 Closes openzfs#12095
When you create a pool, zfs writes vd->vdev_enc_sysfs_path with the enclosure sysfs path to the fault LEDs, like: vdev_enc_sysfs_path = /sys/class/enclosure/0:0:1:0/SLOT8 However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#11950 Closes openzfs#12095
When you create a pool, zfs writes vd->vdev_enc_sysfs_path with the enclosure sysfs path to the fault LEDs, like: vdev_enc_sysfs_path = /sys/class/enclosure/0:0:1:0/SLOT8 However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#11950 Closes openzfs#12095
When you create a pool, zfs writes vd->vdev_enc_sysfs_path with the enclosure sysfs path to the fault LEDs, like: vdev_enc_sysfs_path = /sys/class/enclosure/0:0:1:0/SLOT8 However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tony Hutter <hutter2@llnl.gov> Closes openzfs#11950 Closes openzfs#12095
Motivation and Context
Fix
vdev_enc_sysfs_path
not getting updated on importDescription
When you create a pool, zfs writes
vd->vdev_enc_sysfs_path
with the enclosure sysfs path to the fault LEDs, like:However, this enclosure path doesn't get updated on successive imports even if enclosure path to the disk changes. This patch fixes the issue.
Fixes: #11950
How Has This Been Tested?
On a disk enclosure, I used a fake
vdev_enc_sysfs_path
set from userspace:I then verified with
zdb -C
that the new fake config got set. Then, I exported/imported the pool without the fake and saw the pool correctly set the real vdev_enc_sysfs_path.Types of changes
Checklist:
Signed-off-by
.