zfs/cmd
Tony Hutter f2f6c18f17
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-02-24 11:43:39 -08:00
..
arc_summary Removed Python 2 and Python 3.5- support 2022-01-13 09:51:12 -07:00
arcstat Removed Python 2 and Python 3.5- support 2022-01-13 09:51:12 -07:00
dbufstat Removed Python 2 and Python 3.5- support 2022-01-13 09:51:12 -07:00
fsck_zfs Add `--enable=all` to ShellCheck by default 2022-02-07 11:59:09 -08:00
mount_zfs Rename fallthrough to zfs_fallthrough 2022-02-15 08:58:59 -08:00
raidz_test raidz_test: silence unsigned >=0 warnings 2022-02-18 09:34:52 -08:00
vdev_id Remove basename(1). Clean up/shorten some coreutils pipelines 2021-11-11 13:27:37 -07:00
zdb log xattr=sa create/remove/update to ZIL 2022-02-22 13:06:43 -08:00
zed zed: Misc multipath autoreplace fixes 2022-02-24 11:43:39 -08:00
zfs Correct compilation errors reported by GCC 10/11 2022-02-20 19:20:00 -08:00
zfs_ids_to_path zfs_ids_to_path: print correct wrong values 2021-04-11 11:58:16 -07:00
zgenhostid Prune /*NOTREACHED*/ 2021-07-26 12:07:26 -07:00
zhack module/*.ko: prune .data, global .rodata 2022-01-14 15:37:55 -08:00
zinject zinject: cancel_one_handler: fix unused, remove argsused 2021-12-21 12:05:11 -08:00
zpool Add `--enable=all` to ShellCheck by default 2022-02-07 11:59:09 -08:00
zpool_influxdb Correct compilation errors reported by GCC 10/11 2022-02-20 19:20:00 -08:00
zstream Report dnodes with faulty bonuslen 2022-02-03 14:28:19 -08:00
ztest log xattr=sa create/remove/update to ZIL 2022-02-22 13:06:43 -08:00
zvol_id Add `--enable-asan` and `--enable-ubsan` switches 2022-02-03 14:35:38 -08:00
zvol_wait Add `--enable=all` to ShellCheck by default 2022-02-07 11:59:09 -08:00
Makefile.am Add `--enable=all` to ShellCheck by default 2022-02-07 11:59:09 -08:00