Module Name:    src
Committed By:   jdolecek
Date:           Mon Sep 19 23:32:30 UTC 2016

Modified Files:
        src/sys/dev: ld.c
        src/sys/dev/raidframe: rf_netbsdkintf.c

Log Message:
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)


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ld.c
cvs rdiff -u -r1.345 -r1.346 src/sys/dev/raidframe/rf_netbsdkintf.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/ld.c
diff -u src/sys/dev/ld.c:1.95 src/sys/dev/ld.c:1.96
--- src/sys/dev/ld.c:1.95	Fri Sep 16 15:20:50 2016
+++ src/sys/dev/ld.c	Mon Sep 19 23:32:30 2016
@@ -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 *add
 	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 *add
 		else
 			error = 0;	/* XXX Error out instead? */
 		break;
+
 	default:
-		error = ENOTTY;
+		error = dk_ioctl(dksc, dev, cmd, addr, flag, l);
 		break;
 	}
 

Index: src/sys/dev/raidframe/rf_netbsdkintf.c
diff -u src/sys/dev/raidframe/rf_netbsdkintf.c:1.345 src/sys/dev/raidframe/rf_netbsdkintf.c:1.346
--- src/sys/dev/raidframe/rf_netbsdkintf.c:1.345	Wed Apr 27 02:47:39 2016
+++ src/sys/dev/raidframe/rf_netbsdkintf.c	Mon Sep 19 23:32:30 2016
@@ -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 *d
 	 * 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);
 
 }

Reply via email to