svn commit: r305075 - head/sbin/newfs_msdos
Warner Losh
imp at FreeBSD.org
Tue Aug 30 18:01:27 UTC 2016
Author: imp
Date: Tue Aug 30 18:01:26 2016
New Revision: 305075
URL: https://svnweb.freebsd.org/changeset/base/305075
Log:
The code only converts from bpbHugeSectors to bpbSectors if the sum of
the hidden and huge sectors is less than or equal MAXU16. When
formatting in Windows bpbSectors is still used for 63488 sectors and
2048 hidden (sum > MAXU16). The hidden sectors count is the number of
sectors before the FAT16 Boot Record so it shouldn't affect the sector
count. Attached patch (huge_sec_conversion.patch) to only check for
bpb.bpbHugeSectors <= MAXU16 when converting to bpbSectors.
Submitted by: Guy Yur
PR: 183234
Modified:
head/sbin/newfs_msdos/mkfs_msdos.c
Modified: head/sbin/newfs_msdos/mkfs_msdos.c
==============================================================================
--- head/sbin/newfs_msdos/mkfs_msdos.c Tue Aug 30 18:01:19 2016 (r305074)
+++ head/sbin/newfs_msdos/mkfs_msdos.c Tue Aug 30 18:01:26 2016 (r305075)
@@ -556,7 +556,7 @@ mkfs_msdos(const char *fname, const char
bpb.bpbMedia = !bpb.bpbHiddenSecs ? 0xf0 : 0xf8;
if (fat == 32)
bpb.bpbRootClust = RESFTE;
- if (bpb.bpbHiddenSecs + bpb.bpbHugeSectors <= MAXU16) {
+ if (bpb.bpbHugeSectors <= MAXU16) {
bpb.bpbSectors = bpb.bpbHugeSectors;
bpb.bpbHugeSectors = 0;
}
More information about the svn-src-head
mailing list