svn commit: r219644 - projects/graid/head/sys/geom/raid
Alexander Motin
mav at FreeBSD.org
Mon Mar 14 19:04:44 UTC 2011
Author: mav
Date: Mon Mar 14 19:04:44 2011
New Revision: 219644
URL: http://svn.freebsd.org/changeset/base/219644
Log:
Do not sleep in callout handler context.
Modified:
projects/graid/head/sys/geom/raid/g_raid.c
projects/graid/head/sys/geom/raid/md_intel.c
projects/graid/head/sys/geom/raid/md_jmicron.c
projects/graid/head/sys/geom/raid/md_promise.c
projects/graid/head/sys/geom/raid/md_sii.c
Modified: projects/graid/head/sys/geom/raid/g_raid.c
==============================================================================
--- projects/graid/head/sys/geom/raid/g_raid.c Mon Mar 14 17:22:34 2011 (r219643)
+++ projects/graid/head/sys/geom/raid/g_raid.c Mon Mar 14 19:04:44 2011 (r219644)
@@ -434,7 +434,6 @@ g_raid_event_send(void *arg, int event,
struct g_raid_event *ep;
int error;
- ep = malloc(sizeof(*ep), M_RAID, M_WAITOK);
if ((flags & G_RAID_EVENT_VOLUME) != 0) {
sc = ((struct g_raid_volume *)arg)->v_softc;
} else if ((flags & G_RAID_EVENT_DISK) != 0) {
@@ -444,6 +443,10 @@ g_raid_event_send(void *arg, int event,
} else {
sc = arg;
}
+ ep = malloc(sizeof(*ep), M_RAID,
+ sx_xlocked(&sc->sc_lock) ? M_WAITOK : M_NOWAIT);
+ if (ep == NULL)
+ return (ENOMEM);
ep->e_tgt = arg;
ep->e_event = event;
ep->e_flags = flags;
Modified: projects/graid/head/sys/geom/raid/md_intel.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_intel.c Mon Mar 14 17:22:34 2011 (r219643)
+++ projects/graid/head/sys/geom/raid/md_intel.c Mon Mar 14 19:04:44 2011 (r219644)
@@ -1077,12 +1077,10 @@ g_raid_intel_go(void *arg)
sc = arg;
md = sc->sc_md;
mdi = (struct g_raid_md_intel_object *)md;
- sx_xlock(&sc->sc_lock);
if (!mdi->mdio_started) {
G_RAID_DEBUG1(0, sc, "Force array start due to timeout.");
g_raid_event_send(sc, G_RAID_NODE_E_START, 0);
}
- sx_xunlock(&sc->sc_lock);
}
static int
Modified: projects/graid/head/sys/geom/raid/md_jmicron.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_jmicron.c Mon Mar 14 17:22:34 2011 (r219643)
+++ projects/graid/head/sys/geom/raid/md_jmicron.c Mon Mar 14 19:04:44 2011 (r219644)
@@ -785,12 +785,10 @@ g_raid_jmicron_go(void *arg)
sc = arg;
md = sc->sc_md;
mdi = (struct g_raid_md_jmicron_object *)md;
- sx_xlock(&sc->sc_lock);
if (!mdi->mdio_started) {
G_RAID_DEBUG1(0, sc, "Force array start due to timeout.");
g_raid_event_send(sc, G_RAID_NODE_E_START, 0);
}
- sx_xunlock(&sc->sc_lock);
}
static int
Modified: projects/graid/head/sys/geom/raid/md_promise.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_promise.c Mon Mar 14 17:22:34 2011 (r219643)
+++ projects/graid/head/sys/geom/raid/md_promise.c Mon Mar 14 19:04:44 2011 (r219644)
@@ -854,13 +854,11 @@ g_raid_promise_go(void *arg)
vol = arg;
pv = vol->v_md_data;
sc = vol->v_softc;
- sx_xlock(&sc->sc_lock);
if (!pv->pv_started) {
G_RAID_DEBUG1(0, sc, "Force volume start due to timeout.");
g_raid_event_send(vol, G_RAID_VOLUME_E_STARTMD,
G_RAID_EVENT_VOLUME);
}
- sx_xunlock(&sc->sc_lock);
}
static void
Modified: projects/graid/head/sys/geom/raid/md_sii.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_sii.c Mon Mar 14 17:22:34 2011 (r219643)
+++ projects/graid/head/sys/geom/raid/md_sii.c Mon Mar 14 19:04:44 2011 (r219644)
@@ -864,12 +864,10 @@ g_raid_sii_go(void *arg)
sc = arg;
md = sc->sc_md;
mdi = (struct g_raid_md_sii_object *)md;
- sx_xlock(&sc->sc_lock);
if (!mdi->mdio_started) {
G_RAID_DEBUG1(0, sc, "Force array start due to timeout.");
g_raid_event_send(sc, G_RAID_NODE_E_START, 0);
}
- sx_xunlock(&sc->sc_lock);
}
static int
More information about the svn-src-projects
mailing list