Skip to content

Commit

Permalink
zed: Use ID_MODEL instead of ID_BUS for autoreplace
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
tonyhutter committed Jul 7, 2022
1 parent 74230a5 commit eaa727f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/zed/zed_disk_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ zed_udev_monitor(void *arg)
while (1) {
struct udev_device *dev;
const char *action, *type, *part, *sectors;
const char *bus, *uuid;
const char *model, *uuid;
const char *class, *subclass;
nvlist_t *nvl;
boolean_t is_zfs = B_FALSE;
Expand Down Expand Up @@ -249,9 +249,9 @@ zed_udev_monitor(void *arg)
* for matching with vdevs. Preflight here for expected
* udev information.
*/
bus = udev_device_get_property_value(dev, "ID_BUS");
model = udev_device_get_property_value(dev, "ID_MODEL");
uuid = udev_device_get_property_value(dev, "DM_UUID");
if (!is_zfs && (bus == NULL && uuid == NULL)) {
if (!is_zfs && (model == NULL && uuid == NULL)) {
zed_log_msg(LOG_INFO, "zed_udev_monitor: %s no devid "
"source", udev_device_get_devnode(dev));
udev_device_unref(dev);
Expand Down

0 comments on commit eaa727f

Please sign in to comment.