summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorjdolecek <jdolecek@NetBSD.org>2016-09-19 23:32:30 +0000
committerjdolecek <jdolecek@NetBSD.org>2016-09-19 23:32:30 +0000
commit4e341fdf72641d06b1199f89da9a098ad22c759a (patch)
treebfe220b3ee7b3a5eba3d954c153e7179c2d975e5 /sys/dev
parentc02068e3773fc4e9735cf9e5adaf8830f41a50e0 (diff)
fix DIOCCACHESYNC ioctl on ld(4) and raid(4) to work again; it got broken
when the code was switched over to dk_ioctl() - countrary to disk_ioctl(), dk_ioctl() returns ENOTTY for ioctls it doesn't support, so must be called as last resort, not first bug was introduced in rev 1.83 (2015-05-02) for ld(4), and 1.335 (2016-01-03) for raid(4)
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ld.c11
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c13
2 files changed, 9 insertions, 15 deletions
diff --git a/sys/dev/ld.c b/sys/dev/ld.c
index db6e09221e9..996ac359ad8 100644
--- a/sys/dev/ld.c
+++ b/sys/dev/ld.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.95 2016/09/16 15:20:50 jdolecek Exp $ */
+/* $NetBSD: ld.c,v 1.96 2016/09/19 23:32:30 jdolecek Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.95 2016/09/16 15:20:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.96 2016/09/19 23:32:30 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -353,10 +353,6 @@ ldioctl(dev_t dev, u_long cmd, void *addr, int32_t flag, struct lwp *l)
sc = device_lookup_private(&ld_cd, unit);
dksc = &sc->sc_dksc;
- error = dk_ioctl(dksc, dev, cmd, addr, flag, l);
- if (error != EPASSTHROUGH)
- return (error);
-
error = 0;
switch (cmd) {
@@ -372,8 +368,9 @@ ldioctl(dev_t dev, u_long cmd, void *addr, int32_t flag, struct lwp *l)
else
error = 0; /* XXX Error out instead? */
break;
+
default:
- error = ENOTTY;
+ error = dk_ioctl(dksc, dev, cmd, addr, flag, l);
break;
}
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 57a0d52d595..75dd937c1a7 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.345 2016/04/27 02:47:39 christos Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.346 2016/09/19 23:32:30 jdolecek Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.345 2016/04/27 02:47:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.346 2016/09/19 23:32:30 jdolecek Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -1786,17 +1786,14 @@ raidioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
* Add support for "regular" device ioctls here.
*/
- error = dk_ioctl(dksc, dev, cmd, data, flag, l);
- if (error != EPASSTHROUGH)
- return (error);
-
switch (cmd) {
case DIOCCACHESYNC:
- return rf_sync_component_caches(raidPtr);
+ retcode = rf_sync_component_caches(raidPtr);
default:
- retcode = ENOTTY;
+ retcode = dk_ioctl(dksc, dev, cmd, data, flag, l);
}
+
return (retcode);
}