From owner-p4-projects@FreeBSD.ORG Thu Jun 14 14:26:39 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7957516A46E; Thu, 14 Jun 2007 14:26:39 +0000 (UTC) X-Original-To: perforce@FreeBSD.org Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3AB3C16A46B for ; Thu, 14 Jun 2007 14:26:39 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 2D79713C487 for ; Thu, 14 Jun 2007 14:26:39 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l5EEQdFk051995 for ; Thu, 14 Jun 2007 14:26:39 GMT (envelope-from lulf@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l5EEQc6W051989 for perforce@freebsd.org; Thu, 14 Jun 2007 14:26:38 GMT (envelope-from lulf@FreeBSD.org) Date: Thu, 14 Jun 2007 14:26:38 GMT Message-Id: <200706141426.l5EEQc6W051989@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to lulf@FreeBSD.org using -f From: Ulf Lilleengen To: Perforce Change Reviews Cc: Subject: PERFORCE change 121631 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2007 14:26:39 -0000 http://perforce.freebsd.org/chv.cgi?CH=121631 Change 121631 by lulf@lulf_carrot on 2007/06/14 14:26:33 - Submit a temporarily hack to fix a problem where two or more plexes uses the same BIO. Affected files ... .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_plex.c#12 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_volume.c#3 edit Differences ... ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_plex.c#12 (text+ko) ==== ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_volume.c#3 (text+ko) ==== @@ -112,6 +112,7 @@ struct gv_volume *v; struct gv_plex *p; struct gv_sd *s; + int numplex; s = bp->bio_caller1; KASSERT(s != NULL, ("gv_bio_done: NULL s")); @@ -132,8 +133,36 @@ if (pbp->bio_children == pbp->bio_inbed) { if (pbp->bio_cflags & GV_BIO_SYNCREQ) gv_sync_completed(p, pbp); - else + else { + /* + * If completed is a multiple of a number less + * than or equal to the plexcount, we can be + * sure that a write got through, and adjust + * bio_completed accordingly. + * + * A) We can be sure all plexes will have + * written the BIO, becaouse bio_children == + * bio_inbed which is "global" for all plexes + * since the same BIO was sent to all. + * B) If a plex fails to write totally, we get + * a wrong length/completed number which is + * lower than it should, and the error shouldn't + * really occur. + * + * XXX: This is sort of a hack, but I can't find + * any better way without cloning the initial + * BIO being sent down to all plexes in a mirror + * + * Actually, cloning the BIO would be + * preferable. + */ + numplex = pbp->bio_completed / pbp->bio_length; + if (numplex <= v->plexcount && + (pbp->bio_completed % pbp->bio_length) == 0) + pbp->bio_completed = + pbp->bio_completed / numplex; g_io_deliver(pbp, pbp->bio_error); + } } break; case GV_PLEX_RAID5: