On Fri, Aug 07, 2020 at 12:59:00PM -0700, jo...@armadilloaerospace.com wrote: > Perform an explicit check for the unsupported exFAT MSDOS filesystem > instead of letting it fail mysteriously when it gets cluster sizes > of 0 from the normal fields. > > This causes mount_msdos to report: > mount_msdos: /dev/sd1i on /root/mnt: filesystem not supported by kernel > > Instead of the more obscure: > mount_msdos: /dev/sd1i on /root/mnt: Inapropriate file type or format Much better.
I think this check for the complete string as per https://github.com/MicrosoftDocs/win32/blob/docs/desktop-src/FileIO/exfat-specification.md#312-filesystemname-field The FileSystemName field shall contain the name of the file system on the volume. The valid value for this field is, in ASCII characters, "EXFAT ", which includes three trailing white spaces. /* exFAT specification, 3.1.2 FileSystemName Field */ if (strcmp(bsp->bs33.bsOemName, "EXFAT ") != 0) { ... } > Index: msdosfs_vfsops.c > =================================================================== > RCS file: /cvs/src/sys/msdosfs/msdosfs_vfsops.c,v > retrieving revision 1.93 > diff -u -p -r1.93 msdosfs_vfsops.c > --- msdosfs_vfsops.c 24 Jan 2020 03:49:34 -0000 1.93 > +++ msdosfs_vfsops.c 7 Aug 2020 19:52:04 -0000 > @@ -298,6 +298,12 @@ msdosfs_mountfs(struct vnode *devvp, str > b50 = (struct byte_bpb50 *)bsp->bs50.bsBPB; > b710 = (struct byte_bpb710 *)bsp->bs710.bsBPB; > > + /* No support for exFAT filesystems */ > + if (!strncmp("EXFAT", bsp->bs33.bsOemName, 5)) { > + error = EOPNOTSUPP; > + goto error_exit; > + } > + > pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK | M_ZERO); > pmp->pm_mountp = mp; > > >