From 4e341fdf72641d06b1199f89da9a098ad22c759a Mon Sep 17 00:00:00 2001 From: jdolecek Date: Mon, 19 Sep 2016 23:32:30 +0000 Subject: 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) --- sys/dev/raidframe/rf_netbsdkintf.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'sys/dev/raidframe') 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 -__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); } -- cgit