zfs/cmd/zed
Jorgen Lundman 68301ba20e
zed additional features
This commit adds two features to zed, that macOS desires. The first
is that when you unload the kernel module, zed would enter into a
cpubusy loop calling zfs_events_next() repeatedly. We now look for
ENODEV, returned by kernel, so zed can exit gracefully.

Second feature is -I (idle) (alas -P persist was taken) is for the
deamon to;

1; if started without ZFS kernel module, stick around waiting for it.
2; if kernel module is unloaded, go back to 1.

This is due to daemons in macOS is started by launchctl, and is
expected to stick around.

Currently, the busy loop only exists when errno is ENODEV. This is
to ensure that functionality that upstream expects is not changed.
It did not care about errors before, and it still does not. (with the
exception of ENODEV).

However, it is probably better that all errors
(ERESTART notwithstanding) exits the loop, and the issues complaining
about zed taking all CPU will go away.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #10476
2020-06-22 09:53:34 -07:00
..
agents Mark functions as static 2020-06-18 12:20:38 -07:00
zed.d Systemd mount generator: Generate noauto units; add control properties 2020-02-14 15:32:55 -08:00
.gitignore Initial implementation of zed (ZFS Event Daemon) 2014-04-02 13:10:03 -07:00
Makefile.am Fixed LDADD library links in Makefiles for cross compilation builds 2020-05-09 10:17:08 -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