From: dlg Date: Thu, 9 Nov 2023 14:07:18 +0000 (+0000) Subject: get rid of the ioctl whitelist that bio will tunnel for other devs. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f4d9a9eec7200159a3c2e89336c9cd84e2a81286;p=openbsd get rid of the ioctl whitelist that bio will tunnel for other devs. this will allow bio(4) to be used with other (non raid) related devices. ok krw@ kn@ --- diff --git a/sys/dev/bio.c b/sys/dev/bio.c index f806bd34394..dba3ad42c4f 100644 --- a/sys/dev/bio.c +++ b/sys/dev/bio.c @@ -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); }