Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F174988764
D42337.id129259.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D42337.id129259.diff
View Options
diff --git a/sys/dev/iscsi/iscsi.c b/sys/dev/iscsi/iscsi.c
--- a/sys/dev/iscsi/iscsi.c
+++ b/sys/dev/iscsi/iscsi.c
@@ -44,11 +44,13 @@
#include <sys/mbuf.h>
#include <sys/mutex.h>
#include <sys/module.h>
+#include <sys/reboot.h>
#include <sys/socket.h>
#include <sys/sockopt.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/sx.h>
+
#include <vm/uma.h>
#include <cam/cam.h>
@@ -2711,10 +2713,10 @@
}
static void
-iscsi_shutdown_post(struct iscsi_softc *sc)
+iscsi_shutdown_post_sync(struct iscsi_softc *sc, int howto)
{
- if (!KERNEL_PANICKED()) {
+ if ((howto & RB_NOSYNC) == 0) {
ISCSI_DEBUG("removing all sessions due to shutdown");
iscsi_terminate_sessions(sc);
}
@@ -2751,7 +2753,7 @@
* cam_periph_runccb().
*/
sc->sc_shutdown_post_eh = EVENTHANDLER_REGISTER(shutdown_post_sync,
- iscsi_shutdown_post, sc, SHUTDOWN_PRI_DEFAULT - 1);
+ iscsi_shutdown_post_sync, sc, SHUTDOWN_PRI_DEFAULT - 1);
return (0);
}
diff --git a/sys/dev/pst/pst-raid.c b/sys/dev/pst/pst-raid.c
--- a/sys/dev/pst/pst-raid.c
+++ b/sys/dev/pst/pst-raid.c
@@ -39,6 +39,7 @@
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
+#include <sys/reboot.h>
#include <sys/rman.h>
#include <vm/vm.h>
@@ -73,7 +74,7 @@
static disk_strategy_t pststrategy;
static int pst_probe(device_t);
static int pst_attach(device_t);
-static int pst_shutdown(device_t);
+static void pst_shutdown_post_sync(device_t, int);
static void pst_start(struct pst_softc *);
static void pst_done(struct iop_softc *, u_int32_t, struct i2o_single_reply *);
static int pst_rw(struct pst_request *);
@@ -170,18 +171,21 @@
name, psc->info->capacity/(512*255*63), 255, 63,
device_get_nameunit(psc->iop->dev));
- EVENTHANDLER_REGISTER(shutdown_post_sync, pst_shutdown,
+ EVENTHANDLER_REGISTER(shutdown_post_sync, pst_shutdown_post_sync,
dev, SHUTDOWN_PRI_FIRST);
return 0;
}
-static int
-pst_shutdown(device_t dev)
+static void
+pst_shutdown_post_sync(device_t dev, int howto)
{
struct pst_softc *psc = device_get_softc(dev);
struct i2o_bsa_cache_flush_message *msg;
int mfa;
+ if ((howto & RB_NOSYNC) != 0)
+ return;
+
mfa = iop_get_mfa(psc->iop);
msg = (struct i2o_bsa_cache_flush_message *)(psc->iop->ibase + mfa);
bzero(msg, sizeof(struct i2o_bsa_cache_flush_message));
@@ -194,7 +198,6 @@
msg->control_flags = 0x0; /* 0x80 = post progress reports */
if (iop_queue_wait_msg(psc->iop, mfa, (struct i2o_basic_message *)msg))
printf("pst: shutdown failed!\n");
- return 0;
}
static void
diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -39,6 +39,7 @@
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/reboot.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
@@ -2655,13 +2656,14 @@
static eventhandler_tag g_journal_event_lowmem = NULL;
static void
-g_journal_shutdown(void *arg, int howto __unused)
+g_journal_shutdown_post_sync(void *arg, int howto)
{
struct g_class *mp;
struct g_geom *gp, *gp2;
- if (KERNEL_PANICKED())
+ if ((howto & RB_NOSYNC) != 0)
return;
+
mp = arg;
g_topology_lock();
LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) {
@@ -2738,7 +2740,7 @@
(g_journal_cache_limit / 100) * g_journal_cache_switch;
}
g_journal_event_shutdown = EVENTHANDLER_REGISTER(shutdown_post_sync,
- g_journal_shutdown, mp, EVENTHANDLER_PRI_FIRST);
+ g_journal_shutdown_post_sync, mp, EVENTHANDLER_PRI_FIRST);
if (g_journal_event_shutdown == NULL)
GJ_DEBUG(0, "Warning! Cannot register shutdown event.");
g_journal_event_lowmem = EVENTHANDLER_REGISTER(vm_lowmem,
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -39,6 +39,7 @@
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/reboot.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/sx.h>
@@ -3546,7 +3547,7 @@
struct g_mirror_softc *sc;
int error;
- if (KERNEL_PANICKED())
+ if ((howto & RB_NOSYNC) != 0)
return;
mp = arg;
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -38,6 +38,7 @@
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/reboot.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
@@ -2457,6 +2458,9 @@
struct g_raid_softc *sc;
struct g_raid_volume *vol;
+ if ((howto & RB_NOSYNC) != 0)
+ return;
+
mp = arg;
g_topology_lock();
g_raid_shutdown = 1;
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c
--- a/sys/geom/raid3/g_raid3.c
+++ b/sys/geom/raid3/g_raid3.c
@@ -38,6 +38,7 @@
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/reboot.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/sysctl.h>
@@ -3565,6 +3566,9 @@
struct g_raid3_softc *sc;
int error;
+ if ((howto & RB_NOSYNC) != 0)
+ return;
+
mp = arg;
g_topology_lock();
g_raid3_shutdown = 1;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 8, 10:37 AM (3 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40418024
Default Alt Text
D42337.id129259.diff (5 KB)
Attached To
Mode
D42337: shutdown: audit shutdown_post_sync event callbacks
Attached
Detach File
Event Timeline
Log In to Comment