Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Aug 2016 18:01:26 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305075 - head/sbin/newfs_msdos
Message-ID:  <201608301801.u7UI1QBn089383@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
     }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608301801.u7UI1QBn089383>