Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev fix DIOCCACHESYNC ioctl on ld(4) and raid(4) to work...
details: https://anonhg.NetBSD.org/src/rev/98687f555b1d
branches: trunk
changeset: 347864:98687f555b1d
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Mon Sep 19 23:32:30 2016 +0000
description:
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:
sys/dev/ld.c | 11 ++++-------
sys/dev/raidframe/rf_netbsdkintf.c | 13 +++++--------
2 files changed, 9 insertions(+), 15 deletions(-)
diffs (79 lines):
diff -r 722f7b59c415 -r 98687f555b1d sys/dev/ld.c
--- a/sys/dev/ld.c Mon Sep 19 22:11:41 2016 +0000
+++ b/sys/dev/ld.c Mon Sep 19 23:32:30 2016 +0000
@@ -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 @@
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 @@
else
error = 0; /* XXX Error out instead? */
break;
+
default:
- error = ENOTTY;
+ error = dk_ioctl(dksc, dev, cmd, addr, flag, l);
break;
}
diff -r 722f7b59c415 -r 98687f555b1d sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Mon Sep 19 22:11:41 2016 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Mon Sep 19 23:32:30 2016 +0000
@@ -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 @@
* 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);
}
Home |
Main Index |
Thread Index |
Old Index