Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/dev/raidframe Pull up revision 1.5 (requested by os...



details:   https://anonhg.NetBSD.org/src/rev/9c290a76b3d2
branches:  netbsd-1-4
changeset: 469688:9c290a76b3d2
user:      he <he%NetBSD.org@localhost>
date:      Tue Nov 09 21:54:58 1999 +0000

description:
Pull up revision 1.5 (requested by oster):
  Do not trust the parity disk for read balancing in a RAID 1 set
  if we know that the parity might not be up-to-date (and if we
  have a choice in the matter).

diffstat:

 sys/dev/raidframe/rf_dagutils.c |  28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)

diffs (46 lines):

diff -r 892029c71ec8 -r 9c290a76b3d2 sys/dev/raidframe/rf_dagutils.c
--- a/sys/dev/raidframe/rf_dagutils.c   Tue Nov 09 21:49:25 1999 +0000
+++ b/sys/dev/raidframe/rf_dagutils.c   Tue Nov 09 21:54:58 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagutils.c,v 1.3 1999/02/05 00:06:08 oster Exp $    */
+/*     $NetBSD: rf_dagutils.c,v 1.3.2.1 1999/11/09 21:54:58 he Exp $   */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -1213,21 +1213,25 @@
                if (RF_DEAD_DISK(disks[rowData][colData].status)) {
                        usemirror = 1;
                } else
-                       if (dataQueueLength < mirrorQueueLength) {
+                       if (raidPtr->parity_good == RF_RAID_DIRTY) {
+                               /* Trust only the main disk */
                                usemirror = 0;
                        } else
-                               if (mirrorQueueLength < dataQueueLength) {
-                                       usemirror = 1;
-                               } else {
-                                       /* queues are equal length. attempt
-                                        * cleverness. */
-                                       if (SNUM_DIFF(dataQueue->last_deq_sector, data_pda->startSector)
-                                           <= SNUM_DIFF(mirrorQueue->last_deq_sector, mirror_pda->startSector)) {
-                                               usemirror = 0;
+                               if (dataQueueLength < mirrorQueueLength) {
+                                       usemirror = 0;
+                               } else
+                                       if (mirrorQueueLength < dataQueueLength) {
+                                               usemirror = 1;
                                        } else {
-                                               usemirror = 1;
+                                               /* queues are equal length. attempt
+                                                * cleverness. */
+                                               if (SNUM_DIFF(dataQueue->last_deq_sector, data_pda->startSector)
+                                                   <= SNUM_DIFF(mirrorQueue->last_deq_sector, mirror_pda->startSector)) {
+                                                       usemirror = 0;
+                                               } else {
+                                                       usemirror = 1;
+                                               }
                                        }
-                               }
 
        if (usemirror) {
                /* use mirror (parity) disk, swap params 0 & 4 */



Home | Main Index | Thread Index | Old Index