summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2012-01-22 10:43:51 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2012-01-22 10:43:51 +0000
commit337cb0dba70d5acd53d6a1120eb17df1cd8487b6 (patch)
tree1f6f527b9936179932dfc31c5ada11778372a9bf /sys
parentc781d933bce3e635848c3151463c361863ad42de (diff)
Ensure that the sc_lock is held before the status functions are called.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 9d462b971fb..9977e12051d 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.269 2012/01/21 15:38:44 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.270 2012/01/22 10:43:50 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -1842,6 +1842,8 @@ sr_info(struct sr_softc *sc, const char *fmt, ...)
{
va_list ap;
+ rw_assert_wrlock(&sc->sc_lock);
+
va_start(ap, fmt);
bio_status(&sc->sc_status, 0, BIO_MSG_INFO, fmt, &ap);
va_end(ap);
@@ -1852,6 +1854,8 @@ sr_warn(struct sr_softc *sc, const char *fmt, ...)
{
va_list ap;
+ rw_assert_wrlock(&sc->sc_lock);
+
va_start(ap, fmt);
bio_status(&sc->sc_status, 1, BIO_MSG_WARN, fmt, &ap);
va_end(ap);
@@ -1862,6 +1866,8 @@ sr_error(struct sr_softc *sc, const char *fmt, ...)
{
va_list ap;
+ rw_assert_wrlock(&sc->sc_lock);
+
va_start(ap, fmt);
bio_status(&sc->sc_status, 1, BIO_MSG_ERROR, fmt, &ap);
va_end(ap);