Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Feb 2011 02:48:27 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r218504 - projects/graid/head/sys/geom/raid
Message-ID:  <201102100248.p1A2mRGu006382@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Feb 10 02:48:27 2011
New Revision: 218504
URL: http://svn.freebsd.org/changeset/base/218504

Log:
  Move error counting from subdisk to disk.

Modified:
  projects/graid/head/sys/geom/raid/g_raid.h
  projects/graid/head/sys/geom/raid/tr_raid1.c

Modified: projects/graid/head/sys/geom/raid/g_raid.h
==============================================================================
--- projects/graid/head/sys/geom/raid/g_raid.h	Thu Feb 10 01:24:09 2011	(r218503)
+++ projects/graid/head/sys/geom/raid/g_raid.h	Thu Feb 10 02:48:27 2011	(r218504)
@@ -151,6 +151,7 @@ struct g_raid_disk {
 	u_int			 d_state;	/* Disk state. */
 	u_int			 d_load;	/* Disk average load. */
 	off_t			 d_last_offset;	/* Last head offset. */
+	int			 d_read_errs;	/* Count of the read errors */
 	TAILQ_HEAD(, g_raid_subdisk)	 d_subdisks; /* List of subdisks. */
 	TAILQ_ENTRY(g_raid_disk)	 d_next;	/* Next disk in the node. */
 };
@@ -185,7 +186,6 @@ struct g_raid_subdisk {
 	u_int			 sd_pos;	/* Position in volume. */
 	u_int			 sd_state;	/* Subdisk state. */
 	off_t			 sd_rebuild_pos; /* Rebuild position. */
-	int			 sd_read_errs;  /* Count of the read errors */
 	int			 sd_recovery;	/* Count of recovery reqs. */
 	TAILQ_ENTRY(g_raid_subdisk)	 sd_next; /* Next subdisk on disk. */
 };

Modified: projects/graid/head/sys/geom/raid/tr_raid1.c
==============================================================================
--- projects/graid/head/sys/geom/raid/tr_raid1.c	Thu Feb 10 01:24:09 2011	(r218503)
+++ projects/graid/head/sys/geom/raid/tr_raid1.c	Thu Feb 10 02:48:27 2011	(r218504)
@@ -811,10 +811,10 @@ rebuild_round_done:
 		 * another disk drive, if available, before erroring out the
 		 * read.
 		 */
-		sd->sd_read_errs++;
+		sd->sd_disk->d_read_errs++;
 		G_RAID_LOGREQ(0, bp,
 		    "Read error (%d), %d read errors total",
-		    bp->bio_error, sd->sd_read_errs);
+		    bp->bio_error, sd->sd_disk->d_read_errs);
 
 		/*
 		 * If there are too many read errors, we move to degraded.
@@ -823,7 +823,7 @@ rebuild_round_done:
 		 * drive, which kicks off a resync?
 		 */
 		do_write = 1;
-		if (sd->sd_read_errs > g_raid1_read_err_thresh) {
+		if (sd->sd_disk->d_read_errs > g_raid1_read_err_thresh) {
 			g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk);
 			if (pbp->bio_children == 1)
 				do_write = 0;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102100248.p1A2mRGu006382>