path: root/sbin/geom/misc
diff options
authorUlf Lilleengen <lulf@FreeBSD.org>2008-12-13 14:14:56 +0000
committerUlf Lilleengen <lulf@FreeBSD.org>2008-12-13 14:14:56 +0000
commita468c003ef518f117777db670a2d8ff8a59f61f1 (patch)
tree671f3ce42483cbebf52d0a818ed0d302d2873846 /sbin/geom/misc
parent6fe00c78762349ecf7f7ce7c73c088dcb6542869 (diff)
- 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
Notes: svn path=/head/; revision=186038
Diffstat (limited to 'sbin/geom/misc')
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/geom/misc/subr.c b/sbin/geom/misc/subr.c
index 64df7c6845ed..800cdcfbd69d 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);