diff options
author | Tony Hutter <[email protected]> | 2022-07-11 13:35:19 -0700 |
---|---|---|
committer | GitHub <[email protected]> | 2022-07-11 13:35:19 -0700 |
commit | e4ab3f40df994178c5fc629c2ad07c505f5a76eb (patch) | |
tree | 263300010f105e50711562a2550379ff4c5bd469 /cmd | |
parent | 677ca1e825af80f60569f84803304ccf0092728b (diff) |
zed: Ignore false 'atari' partitions in autoreplace
libudev will sometimes falsely identify an 'atari' partition on a
blank disk, preventing it from being used in an autoreplace. This
seems to be a known issue. The workaround is to just ignore the
fake partition and continue with the autoreplace.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes #13497
Closes #13632
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zed/zed_disk_event.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/cmd/zed/zed_disk_event.c b/cmd/zed/zed_disk_event.c index c4ca54523..97766d571 100644 --- a/cmd/zed/zed_disk_event.c +++ b/cmd/zed/zed_disk_event.c @@ -208,6 +208,12 @@ zed_udev_monitor(void *arg) * if this is a disk and it is partitioned, then the * zfs label will reside in a DEVTYPE=partition and * we can skip passing this event + * + * Special case: Blank disks are sometimes reported with + * an erroneous 'atari' partition, and should not be + * excluded from being used as an autoreplace disk: + * + * https://github.com/openzfs/zfs/issues/13497 */ type = udev_device_get_property_value(dev, "DEVTYPE"); part = udev_device_get_property_value(dev, @@ -215,14 +221,23 @@ zed_udev_monitor(void *arg) if (type != NULL && type[0] != '\0' && strcmp(type, "disk") == 0 && part != NULL && part[0] != '\0') { - zed_log_msg(LOG_INFO, - "%s: skip %s since it has a %s partition already", - __func__, - udev_device_get_property_value(dev, "DEVNAME"), - part); - /* skip and wait for partition event */ - udev_device_unref(dev); - continue; + const char *devname = + udev_device_get_property_value(dev, "DEVNAME"); + + if (strcmp(part, "atari") == 0) { + zed_log_msg(LOG_INFO, + "%s: %s is reporting an atari partition, " + "but we're going to assume it's a false " + "positive and still use it (issue #13497)", + __func__, devname); + } else { + zed_log_msg(LOG_INFO, + "%s: skip %s since it has a %s partition " + "already", __func__, devname, part); + /* skip and wait for partition event */ + udev_device_unref(dev); + continue; + } } /* |