From 5aef9be9a2701a91c5e34e4f1d659e44c8e87869 Mon Sep 17 00:00:00 2001 From: lulf Date: Sat, 13 Dec 2008 14:14:56 +0000 Subject: - 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 --- sbin/geom/misc/subr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sbin/geom') diff --git a/sbin/geom/misc/subr.c b/sbin/geom/misc/subr.c index 64df7c6..800cdcf 100644 --- a/sbin/geom/misc/subr.c +++ b/sbin/geom/misc/subr.c @@ -211,7 +211,7 @@ g_metadata_store(const char *name, u_char *md, size_t size) sector = NULL; error = 0; - fd = open(path, O_WRONLY); + fd = open(path, O_RDWR); if (fd == -1) return (errno); mediasize = g_get_mediasize(name); -- cgit v1.1