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

zed: Use ID_MODEL instead of ID_BUS for autoreplace #13633

Closed
wants to merge 1 commit into from

Conversation

tonyhutter
Copy link
Contributor

Motivation and Context

Fixes #13512

Description

We tried replacing an NVMe drive using autoreplace, only to see zed reject it with:

zed[27955]: zed_udev_monitor: /dev/nvme5n1 no devid source

This happened because ZED saw that ID_BUS was not set by udev for the NVMe drive, and thus didn't think it was "real drive".
A better option is to look for ID_MODEL instead. In testing, I saw ID_MODEL get set for a SATA drive (RHEL 7), SAS drive
(RHEL 8) and NVMe drive (RHEL 8), but not for a virtual drive on a VM.

How Has This Been Tested?

Tested autoreplace using an NVMe drive that had an ID_MODEL udev entry but not ID_BUS.

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:

@tonyhutter tonyhutter added the Component: ZED ZFS Event Daemon label Jul 7, 2022
We tried replacing an NVMe drive using autoreplace, only
to see zed reject it with:

zed[27955]: zed_udev_monitor: /dev/nvme5n1 no devid source

This happened because ZED saw that ID_BUS was not set by udev
for the NVMe drive, and thus didn't think it was "real drive".
A better option is to look for ID_MODEL instead.  In testing,
I saw ID_MODEL get set for a SATA drive (RHEL 7), SAS drive
(RHEL 8) and NVMe drive (RHEL 8), but not for a virtual drive
on a VM.

Fixes: openzfs#13512

Signed-off-by: Tony Hutter <hutter2@llnl.gov>
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Jul 7, 2022
@tonyhutter
Copy link
Contributor Author

There's a tiny likelyhood that the ID_BUS check was filtering out some udev block device events that we didn't want (although I can't imagine what it would be). Just out of pure paranoia, I'm going to close this in favor of #13646 since it is theoretically safer.

@tonyhutter tonyhutter closed this Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ZED ZFS Event Daemon Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zed: ID_BUS not available for autoreplace
2 participants