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 <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Jorgen Lundman <lundman@lundman.net>
Closes #12416
This commit is contained in:
Jorgen Lundman
2021-09-10 02:44:21 +09:00
committed by Tony Hutter
parent 4613504809
commit f31b45176c
8 changed files with 70 additions and 1 deletions
+1
View File
@@ -40,6 +40,7 @@
#include <sys/fm/fs/zfs.h>
#include <libzfs.h>
#include <string.h>
#include <libgen.h>
#include "zfs_agents.h"
#include "fmd_api.h"
+1 -1
View File
@@ -291,7 +291,7 @@ idle:
rv = zed_event_service(&zcp);
/* ENODEV: When kernel module is unloaded (osx) */
if (rv == ENODEV)
if (rv != 0)
break;
}
+1
View File
@@ -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>
+2
View File
@@ -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"