summaryrefslogtreecommitdiffstats
path: root/sys/geom/raid/g_raid.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/raid/g_raid.c')
-rw-r--r--sys/geom/raid/g_raid.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/geom/raid/g_raid.c b/sys/geom/raid/g_raid.c
index fd6d69c..41a1f96 100644
--- a/sys/geom/raid/g_raid.c
+++ b/sys/geom/raid/g_raid.c
@@ -1863,6 +1863,11 @@ g_raid_access(struct g_provider *pp, int acr, int acw, int ace)
error = ENXIO;
goto out;
}
+ /* Deny write opens for read-only volumes. */
+ if (vol->v_read_only && acw > 0) {
+ error = EROFS;
+ goto out;
+ }
if (dcw == 0)
g_raid_clean(vol, dcw);
vol->v_provider_open += acr + acw + ace;
OpenPOWER on IntegriCloud