Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe RAIDF_INITED state also includes disk atta...



details:   https://anonhg.NetBSD.org/src/rev/2fb8b067b144
branches:  trunk
changeset: 342631:2fb8b067b144
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jan 02 16:10:06 2016 +0000

description:
RAIDF_INITED state also includes disk attachments, don't undo operations
that haven't been committed.

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r c045b4553cf0 -r 2fb8b067b144 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sat Jan 02 16:06:25 2016 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sat Jan 02 16:10:06 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.332 2016/01/02 16:06:25 mlelstv Exp $     */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.333 2016/01/02 16:10:06 mlelstv Exp $     */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.332 2016/01/02 16:06:25 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.333 2016/01/02 16:10:06 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1026,17 +1026,20 @@
                return EBUSY;
 
        if ((rs->sc_flags & RAIDF_INITED) == 0)
-               ;       /* not initialized: nothing to do */
-       else if ((error = rf_Shutdown(raidPtr)) != 0)
+               return 0;
+
+       rs->sc_flags &= ~RAIDF_SHUTDOWN;
+
+       if ((error = rf_Shutdown(raidPtr)) != 0)
                return error;
-       else
-               rs->sc_flags &= ~(RAIDF_INITED|RAIDF_SHUTDOWN);
 
        /* Detach the disk. */
        dkwedge_delall(&rs->sc_dkdev);
        disk_detach(&rs->sc_dkdev);
        disk_destroy(&rs->sc_dkdev);
 
+       rs->sc_flags &= ~RAIDF_INITED;
+
        /* Free the softc */
        aprint_normal_dev(rs->sc_dev, "detached\n");
 



Home | Main Index | Thread Index | Old Index