zfs/cmd/zed
Tony Hutter 90abfdf8ee zed: Misc multipath autoreplace fixes
We recently had a case where our operators replaced a bad
multipathed disk, only to see it fail to autoreplace.  The
zed logs showed that the multipath replacement disk did not pass
the 'is_dm' test in zfs_process_add() even though it should have.
is_dm is set if there exists a sysfs entry for to the
underlying /dev/sd* paths for the multipath disk.  It's
possible this path didn't exist due to a race condition where
the sysfs paths weren't created at the time the udev event came
in to zed, but this was never verified.

This patch updates the check to look for udev properties that
indicate if the new autoreplace disk is an empty multipath disk,
rather than looking for the underlying sysfs entries. It also
adds in additional logging, and fixes a bug where zed allowed
you to use an already zfs-formatted disk from another pool
as a multipath auto-replacement disk.

Furthermore, while testing this patch, I also ran across a case
where a force-faulted disk did not have a ZPOOL_CONFIG_PHYS_PATH
entry in its config.  This prevented it from being autoreplaced.
I added additional logic to derive the PHYS_PATH from the PATH if
the PATH was a /dev/disk/by-vdev/ path.  For example, if PATH
was /dev/disk/by-vdev/L28, then PHYS_PATH would be L28.  This is
safe since by-vdev paths represent physical locations and do not
change between boots.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #13023
2022-03-18 06:54:48 -07:00
..
agents zed: Misc multipath autoreplace fixes 2022-03-18 06:54:48 -07:00
zed.d Remove basename(1). Clean up/shorten some coreutils pipelines 2022-02-16 17:58:55 -08:00
.gitignore Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
Makefile.am libspl: implement atomics in terms of atomics 2021-06-21 21:48:31 -07:00
zed.c Upstream: Add snapshot and zvol events 2022-02-10 11:04:06 -08:00
zed.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_conf.c Upstream: Add snapshot and zvol events 2022-02-10 11:04:06 -08:00
zed_conf.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_disk_event.c zed: Misc multipath autoreplace fixes 2022-03-18 06:54:48 -07:00
zed_disk_event.h Bring over illumos ZFS FMA logic -- phase 1 2016-09-01 11:39:45 -07:00
zed_event.c Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_event.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_exec.c Upstream: Add snapshot and zvol events 2022-02-10 11:04:06 -08:00
zed_exec.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_file.c Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_file.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_log.c Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_log.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_strings.c Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00
zed_strings.h Replace ZoL with OpenZFS where applicable 2021-05-10 12:16:46 -07:00