From owner-svn-src-all@FreeBSD.ORG Sat Dec 13 14:14:56 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 BC9EC1065670; Sat, 13 Dec 2008 14:14:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAD128FC0C; Sat, 13 Dec 2008 14:14:56 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBDEEuvX031377; Sat, 13 Dec 2008 14:14:56 GMT (envelope-from lulf@svn.freebsd.org) Received: (from lulf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBDEEu0A031376; Sat, 13 Dec 2008 14:14:56 GMT (envelope-from lulf@svn.freebsd.org) Message-Id: <200812131414.mBDEEu0A031376@svn.freebsd.org> From: Ulf Lilleengen Date: Sat, 13 Dec 2008 14:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: 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: Sat, 13 Dec 2008 14:14:56 -0000 Author: lulf Date: Sat Dec 13 14:14:56 2008 New Revision: 186038 URL: http://svn.freebsd.org/changeset/base/186038 Log: - When writing metadata to a geom provider, open the it as read-write since 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. Note: The reason it fails in the gvinum raid5 case is that gvinum will read back the old parity stripe before calculating the new parity stripe to be written out again. The write will then fail because the underlying disk to be read is opened write only. MFC after: 1 week Modified: head/sbin/geom/misc/subr.c Modified: head/sbin/geom/misc/subr.c ============================================================================== --- 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 = NULL; error = 0; - fd = open(path, O_WRONLY); + fd = open(path, O_RDWR); if (fd == -1) return (errno); mediasize = g_get_mediasize(name);