From owner-svn-src-projects@FreeBSD.ORG Thu Feb 10 02:48:27 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 789001065673; Thu, 10 Feb 2011 02:48:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4F78FC12; Thu, 10 Feb 2011 02:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1A2mRUd006385; Thu, 10 Feb 2011 02:48:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1A2mRGu006382; Thu, 10 Feb 2011 02:48:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201102100248.p1A2mRGu006382@svn.freebsd.org> From: Warner Losh Date: Thu, 10 Feb 2011 02:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218504 - projects/graid/head/sys/geom/raid X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2011 02:48:27 -0000 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;