diff --git a/.topdeps b/.topdeps index 7f16cbcdd5..736703fbec 100644 --- a/.topdeps +++ b/.topdeps @@ -1 +1 @@ -zfs-branch +linux-kernel-module diff --git a/.topmsg b/.topmsg index 82610d817e..0a764489bb 100644 --- a/.topmsg +++ b/.topmsg @@ -1,11 +1,15 @@ From: Brian Behlendorf -Subject: [PATCH] linux kernel module +Subject: [PATCH] linux have sysevent -Setup linux kernel module support, this includes: -- zfs context for kernel/user -- kernel module build system integration -- kernel module macros -- kernel module symbol export -- kernel module options +Use sysevent if HAVE_SYSEVENT defined + +We don't have FMA in Linux, so disable spa_event_notify() to allow +compilation. It would be a good idea to code at least some kind of +ad-hoc notification for such events, e.g., make it output some syslog +messages when a disk faults/fails. + +Also, I think it's FMA in Solaris that is responsible for triggering the +hot spares when a disk starts failing, so we should also think about +doing this in Linux. Signed-off-by: Brian Behlendorf diff --git a/zfs/lib/libzpool/include/sys/spa.h b/zfs/lib/libzpool/include/sys/spa.h index 1029b38294..af6ed0de35 100644 --- a/zfs/lib/libzpool/include/sys/spa.h +++ b/zfs/lib/libzpool/include/sys/spa.h @@ -530,7 +530,11 @@ extern int spa_prop_get(spa_t *spa, nvlist_t **nvp); extern void spa_prop_clear_bootfs(spa_t *spa, uint64_t obj, dmu_tx_t *tx); /* asynchronous event notification */ +#ifdef HAVE_SYSEVENT extern void spa_event_notify(spa_t *spa, vdev_t *vdev, const char *name); +#else +#define spa_event_notify(s,v,n) ((void)0) +#endif #ifdef ZFS_DEBUG #define dprintf_bp(bp, fmt, ...) do { \ diff --git a/zfs/lib/libzpool/spa.c b/zfs/lib/libzpool/spa.c index 942f967696..8af62acf73 100644 --- a/zfs/lib/libzpool/spa.c +++ b/zfs/lib/libzpool/spa.c @@ -4252,10 +4252,10 @@ spa_has_active_shared_spare(spa_t *spa) * in the userland libzpool, as we don't want consumers to misinterpret ztest * or zdb as real changes. */ +#ifdef HAVE_SYSEVENT void spa_event_notify(spa_t *spa, vdev_t *vd, const char *name) { -#ifdef _KERNEL sysevent_t *ev; sysevent_attr_list_t *attr = NULL; sysevent_value_t value; @@ -4300,8 +4300,8 @@ done: if (attr) sysevent_free_attr(attr); sysevent_free(ev); -#endif } +#endif /* HAVE_SYSEVENT */ #if defined(_KERNEL) && defined(HAVE_SPL) /* state manipulation functions */