Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev fss_softc_free: don't detach a disk that is not atta...



details:   https://anonhg.NetBSD.org/src/rev/298e9b890ffd
branches:  trunk
changeset: 753881:298e9b890ffd
user:      hannken <hannken%NetBSD.org@localhost>
date:      Tue Apr 13 07:58:54 2010 +0000

description:
fss_softc_free: don't detach a disk that is not attached.  Disk is
                attached only if the backing store thread is running.

Resolves PR #43153: fss error branch error

diffstat:

 sys/dev/fss.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r d21e9e77f74f -r 298e9b890ffd sys/dev/fss.c
--- a/sys/dev/fss.c     Tue Apr 13 07:32:31 2010 +0000
+++ b/sys/dev/fss.c     Tue Apr 13 07:58:54 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fss.c,v 1.67 2010/04/12 22:29:11 pooka Exp $   */
+/*     $NetBSD: fss.c,v 1.68 2010/04/13 07:58:54 hannken Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.67 2010/04/12 22:29:11 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.68 2010/04/13 07:58:54 hannken Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -473,10 +473,10 @@
                while (sc->sc_bs_lwp != NULL)
                        kpause("fssdetach", false, 1, &sc->sc_slock);
                mutex_exit(&sc->sc_slock);
+
+               disk_detach(sc->sc_dkdev);
        }
 
-       disk_detach(sc->sc_dkdev);
-
        if (sc->sc_copied != NULL)
                kmem_free(sc->sc_copied, howmany(sc->sc_clcount, NBBY));
        sc->sc_copied = NULL;



Home | Main Index | Thread Index | Old Index