aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2021-09-10 02:44:21 +0900
committerGitHub <[email protected]>2021-09-09 10:44:21 -0700
commit5a54a4e0517959dd917c0f78d692f7364e597a68 (patch)
tree1b8ea31a0f6bbb79fe9b8d62da80f3b1954a81ed /cmd
parent2079111f42a90b123f484337b43a549b7c5e50ba (diff)
Upstream: Add snapshot and zvol events
For kernel to send snapshot mount/unmount events to zed. For kernel to send symlink creates/removes on zvol plumbing. (/dev/run/dsk/zvol/$pool/$zvol -> /dev/diskX) If zed misses the ENODEV, all errors after are EINVAL. Treat any error as kernel module failure. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #12416
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zed/agents/zfs_retire.c1
-rw-r--r--cmd/zed/zed.c2
-rw-r--r--cmd/zed/zed_conf.c1
-rw-r--r--cmd/zed/zed_exec.c2
4 files changed, 5 insertions, 1 deletions
diff --git a/cmd/zed/agents/zfs_retire.c b/cmd/zed/agents/zfs_retire.c
index 1563f5d27..6c009bdc1 100644
--- a/cmd/zed/agents/zfs_retire.c
+++ b/cmd/zed/agents/zfs_retire.c
@@ -41,6 +41,7 @@
#include <libzutil.h>
#include <libzfs.h>
#include <string.h>
+#include <libgen.h>
#include "zfs_agents.h"
#include "fmd_api.h"
diff --git a/cmd/zed/zed.c b/cmd/zed/zed.c
index 0aa03fded..e45176c00 100644
--- a/cmd/zed/zed.c
+++ b/cmd/zed/zed.c
@@ -291,7 +291,7 @@ idle:
rv = zed_event_service(&zcp);
/* ENODEV: When kernel module is unloaded (osx) */
- if (rv == ENODEV)
+ if (rv != 0)
break;
}
diff --git a/cmd/zed/zed_conf.c b/cmd/zed/zed_conf.c
index 2cf2311db..59935102f 100644
--- a/cmd/zed/zed_conf.c
+++ b/cmd/zed/zed_conf.c
@@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <unistd.h>
diff --git a/cmd/zed/zed_exec.c b/cmd/zed/zed_exec.c
index 1eecfa0a9..03dcd03ac 100644
--- a/cmd/zed/zed_exec.c
+++ b/cmd/zed/zed_exec.c
@@ -26,6 +26,8 @@
#include <time.h>
#include <unistd.h>
#include <pthread.h>
+#include <signal.h>
+
#include "zed_exec.h"
#include "zed_log.h"
#include "zed_strings.h"