cvs commit: src/sys/fs/msdosfs bpb.h

Bruce Evans bde at
Tue Dec 19 03:21:32 PST 2006

On Tue, 19 Dec 2006, Craig Rodrigues wrote:

> rodrigc     2006-12-19 01:55:45 UTC
>  FreeBSD src repository
>  Modified files:
>    sys/fs/msdosfs       bpb.h
>  Log:
>  Fix get_ulong() macro on AMD64 (or any little-endian 64-bit platform).
>  This bug caused vn_stat() to fail on files larger than 2gb on msdosfs
>  filesystems on AMD64.
>  PR:             106703
>  Tested by:      Axel Gonzalez <loox e-shell net>
>  MFC after:      3 days
>  Revision  Changes    Path
>  1.12      +1 -5      src/sys/fs/msdosfs/bpb.h

This breaks many more cases than it fixes, by removing support for
arches with strict alignment requirements.  It fixes little-endian
arches with 64-bit longs and no strict alignment requirements (mainly
amd64) almost accidentally by not using the broken generic getulong()
macro for them.  It freshly breaks all little-endian arches with strict
alignment requirements (mainly ia64).

The overflow bug remains unchanged.  It now affects all non-little-endian
arches with 64-bit longs (mainly sparc64).  It is fixed in practice
by the patch in the PR which is in the next commit (rev.1.13), but
that patch has has some style bugs and is logically wrong.  It makes
a line too long and fixes up overflow after overflow has already
occurred.  I discussed this with another committer in private (?) mail
but apparently frightened him by trying to explain the bug and various
correct fixes for it in detail.


More information about the cvs-src mailing list