Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Abort any parity re-writes before unconfig...



details:   https://anonhg.NetBSD.org/src/rev/e0d781bb1618
branches:  trunk
changeset: 486744:e0d781bb1618
user:      oster <oster%NetBSD.org@localhost>
date:      Sun May 28 03:00:31 2000 +0000

description:
Abort any parity re-writes before unconfiguring a RAID set.
Partially addresses PR#10182.

diffstat:

 sys/dev/raidframe/rf_driver.c      |  9 ++++++++-
 sys/dev/raidframe/rf_netbsdkintf.c |  7 ++++++-
 sys/dev/raidframe/rf_parityscan.c  |  7 ++++++-
 3 files changed, 20 insertions(+), 3 deletions(-)

diffs (65 lines):

diff -r 66b7e24ad144 -r e0d781bb1618 sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c     Sun May 28 02:49:35 2000 +0000
+++ b/sys/dev/raidframe/rf_driver.c     Sun May 28 03:00:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_driver.c,v 1.34 2000/03/07 02:28:05 oster Exp $     */
+/*     $NetBSD: rf_driver.c,v 1.35 2000/05/28 03:00:32 oster Exp $     */
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -267,6 +267,13 @@
        }
        RF_FREELIST_DO_UNLOCK(rf_rad_freelist);
 
+       /* Wait for any parity re-writes to stop... */
+       while (raidPtr->parity_rewrite_in_progress) {
+               printf("Waiting for parity re-write to exit...\n");
+               tsleep(&raidPtr->parity_rewrite_in_progress, PRIBIO,
+                      "rfprwshutdown", 0);
+       }
+
        raidPtr->valid = 0;
 
        rf_final_update_component_labels(raidPtr);
diff -r 66b7e24ad144 -r e0d781bb1618 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Sun May 28 02:49:35 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Sun May 28 03:00:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.84 2000/05/28 01:03:22 oster Exp $        */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.85 2000/05/28 03:00:31 oster Exp $        */
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -2617,6 +2617,11 @@
        }
        raidPtr->parity_rewrite_in_progress = 0;
 
+       /* Anyone waiting for us to stop?  If so, inform them... */
+       if (raidPtr->waitShutdown) {
+               wakeup(&raidPtr->parity_rewrite_in_progress);
+       }
+
        /* That's all... */
        kthread_exit(0);        /* does not return */
 }
diff -r 66b7e24ad144 -r e0d781bb1618 sys/dev/raidframe/rf_parityscan.c
--- a/sys/dev/raidframe/rf_parityscan.c Sun May 28 02:49:35 2000 +0000
+++ b/sys/dev/raidframe/rf_parityscan.c Sun May 28 03:00:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_parityscan.c,v 1.8 2000/01/05 02:57:28 oster Exp $  */
+/*     $NetBSD: rf_parityscan.c,v 1.9 2000/05/28 03:00:31 oster Exp $  */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -89,6 +89,11 @@
        for (i = 0; i < raidPtr->totalSectors && 
                     rc <= RF_PARITY_CORRECTED; 
             i += layoutPtr->dataSectorsPerStripe) {
+               if (raidPtr->waitShutdown) {
+                       /* Someone is pulling the plug on this set...
+                          abort the re-write */
+                       return (1);
+               }
                asm_h = rf_MapAccess(raidPtr, i, 
                                     layoutPtr->dataSectorsPerStripe, 
                                     NULL, RF_DONT_REMAP);



Home | Main Index | Thread Index | Old Index