get rid of the ioctl whitelist that bio will tunnel for other devs.
authordlg <dlg@openbsd.org>
Thu, 9 Nov 2023 14:07:18 +0000 (14:07 +0000)
committerdlg <dlg@openbsd.org>
Thu, 9 Nov 2023 14:07:18 +0000 (14:07 +0000)
this will allow bio(4) to be used with other (non raid) related
devices.

ok krw@ kn@

sys/dev/bio.c

index f806bd3..dba3ad4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: bio.c,v 1.17 2015/08/26 22:28:57 deraadt Exp $        */
+/*     $OpenBSD: bio.c,v 1.18 2023/11/09 14:07:18 dlg Exp $    */
 
 /*
  * Copyright (c) 2002 Niklas Hallqvist.  All rights reserved.
@@ -89,25 +89,16 @@ bioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
                        return (ENOENT);
                break;
 
-       case BIOCINQ:
-       case BIOCDISK:
-       case BIOCVOL:
-       case BIOCALARM:
-       case BIOCBLINK:
-       case BIOCSETSTATE:
-       case BIOCCREATERAID:
-       case BIOCDELETERAID:
-       case BIOCDISCIPLINE:
-       case BIOCPATROL:
+       default:
                bio = (struct bio *)addr;
                if (!bio_validate(bio->bio_cookie))
                        return (ENOENT);
-               return (bio_delegate_ioctl(
-                   (struct bio_mapping *)bio->bio_cookie, cmd, addr));
 
-       default:
-               return (ENXIO);
+               error = bio_delegate_ioctl(
+                   (struct bio_mapping *)bio->bio_cookie, cmd, addr);
+               break;
        }
+
        return (0);
 }