Module Name:    src
Committed By:   christos
Date:           Fri Aug 21 09:33:53 UTC 2015

Modified Files:
        src/sys/dev: cgd.c

Log Message:
don't allow STRATEGY if we are not inited.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/cgd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.102 src/sys/dev/cgd.c:1.103
--- src/sys/dev/cgd.c:1.102	Thu Aug 20 10:40:17 2015
+++ src/sys/dev/cgd.c	Fri Aug 21 05:33:53 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.102 2015/08/20 14:40:17 christos Exp $ */
+/* $NetBSD: cgd.c,v 1.103 2015/08/21 09:33:53 christos Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.102 2015/08/20 14:40:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.103 2015/08/21 09:33:53 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -563,6 +563,11 @@ cgdioctl(dev_t dev, u_long cmd, void *da
 		 * We pass this call down to the underlying disk.
 		 */
 		return VOP_IOCTL(cs->sc_tvn, cmd, data, flag, l->l_cred);
+	case DIOCGSTRATEGY:
+	case DIOCSSTRATEGY:
+		if ((dksc->sc_flags & DKF_INITED) == 0)
+			return ENOENT;
+		/*FALLTHROUGH*/
 	default:
 		return dk_ioctl(dksc, dev, cmd, data, flag, l);
 	case CGDIOCGET:

Reply via email to