zfs/cmd/zed
Brian Behlendorf 5266a0728a
ZED: Do not offline a missing device if no spare is available
Due to commit d48091d a removed device is now explicitly offlined by
the ZED if no spare is available, rather than the letting ZFS detect
it as UNAVAIL. This broke auto-replacing of whole-disk devices, as
described in issue #10577.  In short, when a new device is reinserted
in the same slot, the ZED will try to ONLINE it without letting ZFS
recreate the necessary partition table.

This change simply avoids setting the device OFFLINE when removed if
no spare is available (or if spare_on_remove is false).  This change
has been left minimal to allow it to be backported to 0.8.x release.
The auto_offline_001_pos ZTS test has been updated accordingly.

Some follow up work is planned to update the ZED so it transitions
the vdev to a REMOVED state.  This is a state which has always
existed but there is no current interface the ZED can use to
accomplish this.  Therefore it's being left to a follow up PR.

Reviewed-by: Gionatan Danti <g.danti@assyoma.it>
Co-authored-by: Gionatan Danti <g.danti@assyoma.it>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #10577
Closes #10730
2020-08-18 22:13:17 -07:00
..
agents ZED: Do not offline a missing device if no spare is available 2020-08-18 22:13:17 -07:00
zed.d Centralize variable substitution 2020-07-14 17:33:44 -07:00
.gitignore Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
Makefile.am Use abs_top_builddir when referencing libraries 2020-07-10 14:26:32 -07:00
zed.c zed additional features 2020-06-22 09:53:34 -07:00
zed.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_conf.c zed additional features 2020-06-22 09:53:34 -07:00
zed_conf.h zed additional features 2020-06-22 09:53:34 -07:00
zed_disk_event.c Add libzutil for libzfs or libzpool consumers 2018-11-05 11:22:33 -08:00
zed_disk_event.h Bring over illumos ZFS FMA logic -- phase 1 2016-09-01 11:39:45 -07:00
zed_event.c zed additional features 2020-06-22 09:53:34 -07:00
zed_event.h zed additional features 2020-06-22 09:53:34 -07:00
zed_exec.c Add include files for prototypes 2020-06-18 12:21:25 -07:00
zed_exec.h Add include files for prototypes 2020-06-18 12:21:25 -07:00
zed_file.c Add include files for prototypes 2020-06-18 12:21:25 -07:00
zed_file.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_log.c Add missing includes to zed_log.c 2017-04-12 08:57:25 -07:00
zed_log.h Update ZED copyright boilerplate 2015-05-11 15:07:00 -07:00
zed_strings.c Mark functions as static 2020-06-18 12:20:38 -07:00
zed_strings.h Use cstyle -cpP in `make cstyle` check 2016-12-12 10:46:26 -08:00