Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6-0]: src/sys/dev Pull up following revision(s) (requested by han...
details: https://anonhg.NetBSD.org/src/rev/a4bb3cf17df1
branches: netbsd-6-0
changeset: 774766:a4bb3cf17df1
user: riz <riz%NetBSD.org@localhost>
date: Sun Feb 10 23:57:38 2013 +0000
description:
Pull up following revision(s) (requested by hannken in ticket #808):
sys/dev/fss.c: revision 1.84
Take fss_device_lock first when closing a fss device.
Fixes PR kern/47514 (Multiple dump -X triggers kernel panic in fss_ioctl)
diffstat:
sys/dev/fss.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diffs (46 lines):
diff -r ec171278533a -r a4bb3cf17df1 sys/dev/fss.c
--- a/sys/dev/fss.c Sun Feb 10 20:21:06 2013 +0000
+++ b/sys/dev/fss.c Sun Feb 10 23:57:38 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fss.c,v 1.81.4.1 2012/07/30 08:05:33 martin Exp $ */
+/* $NetBSD: fss.c,v 1.81.4.1.4.1 2013/02/10 23:57:38 riz Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.81.4.1 2012/07/30 08:05:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.81.4.1.4.1 2013/02/10 23:57:38 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -223,11 +223,13 @@
mflag = (mode == S_IFCHR ? FSS_CDEV_OPEN : FSS_BDEV_OPEN);
error = 0;
+ mutex_enter(&fss_device_lock);
restart:
mutex_enter(&sc->sc_slock);
if ((sc->sc_flags & (FSS_CDEV_OPEN|FSS_BDEV_OPEN)) != mflag) {
sc->sc_flags &= ~mflag;
mutex_exit(&sc->sc_slock);
+ mutex_exit(&fss_device_lock);
return 0;
}
if ((sc->sc_flags & FSS_ACTIVE) != 0 &&
@@ -239,12 +241,9 @@
}
if ((sc->sc_flags & FSS_ACTIVE) != 0) {
mutex_exit(&sc->sc_slock);
+ mutex_exit(&fss_device_lock);
return error;
}
- if (! mutex_tryenter(&fss_device_lock)) {
- mutex_exit(&sc->sc_slock);
- goto restart;
- }
KASSERT((sc->sc_flags & FSS_ACTIVE) == 0);
KASSERT((sc->sc_flags & (FSS_CDEV_OPEN|FSS_BDEV_OPEN)) == mflag);
Home |
Main Index |
Thread Index |
Old Index