From owner-svn-src-projects@FreeBSD.ORG Sun Jan 30 23:14:35 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 2D7831065674; Sun, 30 Jan 2011 23:14:35 +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 1E2A28FC08; Sun, 30 Jan 2011 23:14:35 +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 p0UNEZP8088834; Sun, 30 Jan 2011 23:14:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0UNEZQ2088832; Sun, 30 Jan 2011 23:14:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201101302314.p0UNEZQ2088832@svn.freebsd.org> From: Warner Losh Date: Sun, 30 Jan 2011 23:14:34 +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: r218106 - 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: Sun, 30 Jan 2011 23:14:35 -0000 Author: imp Date: Sun Jan 30 23:14:34 2011 New Revision: 218106 URL: http://svn.freebsd.org/changeset/base/218106 Log: Improve the remap comment, add a question about failing vs degrading a disk on the Nth read error. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Sun Jan 30 22:57:52 2011 (r218105) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Sun Jan 30 23:14:34 2011 (r218106) @@ -720,6 +720,9 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ /* * If there are too many read errors, we move to degraded. + * XXX Do we want to FAIL the drive (eg, make the user redo + * everything to get it back in sync), or just degrade the + * drive, which kicks off a resync? */ if (sd->sd_read_errs > SD_READ_THRESHOLD) { g_raid_fail_disk(sd->sd_softc, sd, sd->sd_disk); @@ -779,10 +782,13 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ } if (bp->bio_cflags & G_RAID_BIO_FLAG_REMAP) { /* - * We're doing a remap write, mark the range as unlocked now - * and fail the disk if the write failed. If the write - * failed, the parent's bio isn't failed since the recovered - * read for that actually succeeded. + * We're done with a remap write, mark the range as unlocked. + * For any write errors, we agressively fail the disk since + * there was both a READ and a WRITE error at this location. Both + * types of errors generally indicates the drive is on the verge of + * total failure anyway. Better to stop trusting it now. However, + * we need to reset error to 0 in that case because we're not failing + * the original I/O which succeeded. */ G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, bp->bio_offset,