Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Oct 2012 21:08:07 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242328 - head/sys/geom/raid
Message-ID:  <201210292108.q9TL87r8044495@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Oct 29 21:08:06 2012
New Revision: 242328
URL: http://svn.freebsd.org/changeset/base/242328

Log:
  Minor addition to r242323:
  Alike to BIO_WRITE, report success if at least one subdisk succeeded with
  BIO_DELETE.  But unlike BIO_WRITE don't fail disk on BIO_DELETE error.
  
  Sponsored by:	iXsystems, Inc.
  MFC after:	1 month

Modified:
  head/sys/geom/raid/tr_raid1.c
  head/sys/geom/raid/tr_raid1e.c

Modified: head/sys/geom/raid/tr_raid1.c
==============================================================================
--- head/sys/geom/raid/tr_raid1.c	Mon Oct 29 20:47:32 2012	(r242327)
+++ head/sys/geom/raid/tr_raid1.c	Mon Oct 29 21:08:06 2012	(r242328)
@@ -891,10 +891,10 @@ rebuild_round_done:
 		g_raid_unlock_range(sd->sd_volume, bp->bio_offset,
 		    bp->bio_length);
 	}
-	if (pbp->bio_cmd == BIO_WRITE) {
+	if (pbp->bio_cmd != BIO_READ) {
 		if (pbp->bio_inbed == 1 || pbp->bio_error != 0)
 			pbp->bio_error = bp->bio_error;
-		if (bp->bio_error != 0) {
+		if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) {
 			G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk.");
 			g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk);
 		}

Modified: head/sys/geom/raid/tr_raid1e.c
==============================================================================
--- head/sys/geom/raid/tr_raid1e.c	Mon Oct 29 20:47:32 2012	(r242327)
+++ head/sys/geom/raid/tr_raid1e.c	Mon Oct 29 21:08:06 2012	(r242328)
@@ -1118,10 +1118,10 @@ rebuild_round_done:
 		G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error);
 		g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length);
 	}
-	if (pbp->bio_cmd == BIO_WRITE) {
+	if (pbp->bio_cmd != BIO_READ) {
 		if (pbp->bio_inbed == 1 || pbp->bio_error != 0)
 			pbp->bio_error = bp->bio_error;
-		if (bp->bio_error != 0) {
+		if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) {
 			G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk.");
 			g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk);
 		}



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