diff options
Diffstat (limited to 'sys/geom/geom_pc98.c')
-rw-r--r-- | sys/geom/geom_pc98.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c index f30cb9d..d887b25 100644 --- a/sys/geom/geom_pc98.c +++ b/sys/geom/geom_pc98.c @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include <sys/endian.h> #include <sys/systm.h> #include <sys/kernel.h> +#include <sys/fcntl.h> #include <sys/malloc.h> #include <sys/bio.h> #include <sys/lock.h> @@ -148,7 +149,7 @@ g_pc98_modify(struct g_geom *gp, struct g_pc98_softc *ms, u_char *sec) } static int -g_pc98_ioctl(struct g_provider *pp, u_long cmd, void *data, struct thread *td) +g_pc98_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, struct thread *td) { struct g_geom *gp; struct g_pc98_softc *ms; @@ -162,6 +163,8 @@ g_pc98_ioctl(struct g_provider *pp, u_long cmd, void *data, struct thread *td) switch(cmd) { case DIOCSPC98: { + if (!(fflag & FWRITE)) + return (EPERM); DROP_GIANT(); g_topology_lock(); /* Validate and modify our slicer instance to match. */ |