On 08/15/17 17:20, Stefan Fritsch wrote: > Hi, > > this is another try at making read clustering work for msdosfs. > > Last year, mpi@ implemented VFS read clustering for MSDOSFS in > > sys/msdosfs/denode.h 1.28 > sys/msdosfs/msdosfs_vnops.c 1.105 > > This caused regressions when doing seeks past the end of the file and had. > to be reverted. Then I tried to fix that in > > denode.h,v 1.31 > msdosfs_vnops.c,v 1.114 > > But that caused different problems and had to be reverted, too. I have > another test for that that I will commit soon. > > It seems that while netbsd uses DEV_BSIZE as base for the logical block > numbers even in files, openbsd is more like freebsd and uses > mnt_stat.f_iosize in that case. However, if the file system does accesses > for metadata on the disk, it has to use DEV_BSIZE for accesses. So the > fixes in 1.31/1.114 were wrong and the following diff is again based on > 1.28/1.105 with some fixes in extendfile() to make seeks past the end of > the file work. > > > Testers/reviews/OKs welcome. Especially people who need msdosfs for > booting via uefi. In any case, I won't commit until I get home again in a > week. > > If my analysis with the block sizes is correct, I will add some > clarifications to the bread/bwrite man page later.
Since I was the one who raised the second problem [0], I tried this patch and everything seems to work fine. When I copy a binary file on a msdos (uefi) partition (running the kernel with the patch) the checksum remains the same: # cp refind_x64.efi bootx64.efi # ls -l refind_x64.efi bootx64.efi -rw-r--r-- 1 root wheel 230856 Aug 15 19:49 bootx64.efi -rw-r--r-- 1 root wheel 230856 Mar 9 11:09 refind_x64.efi # sha256 refind_x64.efi bootx64.efi SHA256 (refind_x64.efi) = 968596f40353ab8140867e71928fcd4c0bc2f39397aba8324f7255bcd57f0913 SHA256 (bootx64.efi) = 968596f40353ab8140867e71928fcd4c0bc2f39397aba8324f7255bcd57f0913 Kind regards, Martijn Rijkeboer [0] http://marc.info/?l=openbsd-tech&m=149725838018944&w=2