summaryrefslogtreecommitdiffstats
path: root/sbin/geom
diff options
context:
space:
mode:
authorlulf <lulf@FreeBSD.org>2008-12-13 14:14:56 +0000
committerlulf <lulf@FreeBSD.org>2008-12-13 14:14:56 +0000
commit5aef9be9a2701a91c5e34e4f1d659e44c8e87869 (patch)
tree671f3ce42483cbebf52d0a818ed0d302d2873846 /sbin/geom
parent57939c399f73afce189b6e3f815acf369c90e8f2 (diff)
downloadFreeBSD-src-5aef9be9a2701a91c5e34e4f1d659e44c8e87869.zip
FreeBSD-src-5aef9be9a2701a91c5e34e4f1d659e44c8e87869.tar.gz
- 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
Diffstat (limited to 'sbin/geom')
-rw-r--r--sbin/geom/misc/subr.c2
1 files changed, 1 insertions, 1 deletions
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);
OpenPOWER on IntegriCloud