From owner-svn-src-all@FreeBSD.ORG Sun Dec 14 19:21:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F6C91065670; Sun, 14 Dec 2008 19:21:09 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: from mail.garage.freebsd.pl (chello087206045082.chello.pl [87.206.45.82]) by mx1.freebsd.org (Postfix) with ESMTP id 5CD498FC17; Sun, 14 Dec 2008 19:21:08 +0000 (UTC) (envelope-from pjd@garage.freebsd.pl) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 7EEE745B26; Sun, 14 Dec 2008 20:21:05 +0100 (CET) Received: from localhost (chello087206045082.chello.pl [87.206.45.82]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id E5EE64569A; Sun, 14 Dec 2008 20:20:59 +0100 (CET) Date: Sun, 14 Dec 2008 20:21:01 +0100 From: Pawel Jakub Dawidek To: Ulf Lilleengen Message-ID: <20081214192100.GB16926@garage.freebsd.pl> References: <200812131414.mBDEEu0A031376@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline In-Reply-To: <200812131414.mBDEEu0A031376@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 8.0-CURRENT i386 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r186038 - head/sbin/geom/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Dec 2008 19:21:09 -0000 --H+4ONPRPur6+Ovig Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Dec 13, 2008 at 02:14:56PM +0000, Ulf Lilleengen wrote: > Author: lulf > Date: Sat Dec 13 14:14:56 2008 > New Revision: 186038 > URL: http://svn.freebsd.org/changeset/base/186038 >=20 > Log: > - When writing metadata to a geom provider, open the it as read-write s= ince it > might do subsequent reads from other providers. This stopped geli (and > probably other classes using g_metadata_store as well) from being put= on top > of gvinum raid5 volumes. > =20 > Note: > The reason it fails in the gvinum raid5 case is that gvinum will read b= ack the > old parity stripe before calculating the new parity stripe to be writte= n out > again. The write will then fail because the underlying disk to be read= is > opened write only. I think we discussed this in the past. In my opinion this change is incorrect. The intend here is to only write something, that's why I use O_WRONLY. If gvinum/raid5 needs also read something to satisfy the write, this is gvinum/raid5's internal detail and should be handled there. RAID5 by design needs to read before it can write (in most cases), does it mean that the O_WRONLY flag became bogus suddenly? No. The flag given to open(2) describes caller's intend, not provider's internals. > Modified: > head/sbin/geom/misc/subr.c >=20 > Modified: head/sbin/geom/misc/subr.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sbin/geom/misc/subr.c Sat Dec 13 13:07:12 2008 (r186037) > +++ head/sbin/geom/misc/subr.c Sat Dec 13 14:14:56 2008 (r186038) > @@ -211,7 +211,7 @@ g_metadata_store(const char *name, u_cha > sector =3D NULL; > error =3D 0; > =20 > - fd =3D open(path, O_WRONLY); > + fd =3D open(path, O_RDWR); > if (fd =3D=3D -1) > return (errno); > mediasize =3D g_get_mediasize(name); --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --H+4ONPRPur6+Ovig Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFJRVybForvXbEpPzQRAgc3AJ9DzXxiEepsESTEcxQpnh4UIrBKHQCg1n7F pr0qTfPiyIFilu/4mEZuAbQ= =IphU -----END PGP SIGNATURE----- --H+4ONPRPur6+Ovig--