summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2020-08-10 05:18:46 +0000
committerjsg <jsg@openbsd.org>2020-08-10 05:18:46 +0000
commitc34741d6f3a9c6b64e252c1213e459bfafb65565 (patch)
tree678404e154093e1fd2879b97927b5f943bf067e8
parentRemove the acpicpu_sc array and instead locate acpicpu instances using (diff)
downloadwireguard-openbsd-c34741d6f3a9c6b64e252c1213e459bfafb65565.tar.xz
wireguard-openbsd-c34741d6f3a9c6b64e252c1213e459bfafb65565.zip
consistently return EINVAL on invalid BPB
reverts changes from msdosfs_vfsops.c rev 1.7 Prompted by a patch from John Carmack to add an an error path when exFAT is detected on mount to give a more helpful error message. Returning EINVAL in the existing sanity checks will make mount_msdos(8) print "not an MSDOS filesystem" when attempting to mount exFAT and matches historic and documented behaviour. ok kn@
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 657ddeecafa..5be9e107160 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.93 2020/01/24 03:49:34 tedu Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.94 2020/08/10 05:18:46 jsg Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -321,7 +321,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p,
pmp->pm_BlkPerSec = pmp->pm_BytesPerSec / DEV_BSIZE;
if (!pmp->pm_BytesPerSec || !SecPerClust) {
- error = EFTYPE;
+ error = EINVAL;
goto error_exit;
}
@@ -451,7 +451,7 @@ msdosfs_mountfs(struct vnode *devvp, struct mount *mp, struct proc *p,
* must be a power of 2
*/
if (pmp->pm_bpcluster ^ (1 << pmp->pm_cnshift)) {
- error = EFTYPE;
+ error = EINVAL;
goto error_exit;
}