summaryrefslogtreecommitdiffstats
path: root/sbin/newfs_msdos
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-10-15 16:06:10 +0000
committeremaste <emaste@FreeBSD.org>2015-10-15 16:06:10 +0000
commit9bdc4300cdfdf55315c7330f03552bd47674d2cb (patch)
treee3c57a3836c2b76a107c4a12c69b811d7dac689c /sbin/newfs_msdos
parent2cefe1a092b6157bf7a651c3fe9e5b8f2465a6d2 (diff)
downloadFreeBSD-src-9bdc4300cdfdf55315c7330f03552bd47674d2cb.zip
FreeBSD-src-9bdc4300cdfdf55315c7330f03552bd47674d2cb.tar.gz
MFC r264889: newfs_msdos: Correct min/max cluster counts for FAT12/16/32
FAT12 1..4084 FAT16 4085..65524 FAT32 65525.. This is required for interoperability with other FAT implementations, and in particular UEFI. Obtained from: NetBSD Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sbin/newfs_msdos')
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index 69b92d0..34abd55 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -64,11 +64,11 @@ static const char rcsid[] =
#define DEFRDE 512 /* default root directory entries */
#define RESFTE 2 /* reserved FAT entries */
#define MINCLS12 1U /* minimum FAT12 clusters */
-#define MINCLS16 0x1000U /* minimum FAT16 clusters */
-#define MINCLS32 2U /* minimum FAT32 clusters */
-#define MAXCLS12 0xfedU /* maximum FAT12 clusters */
-#define MAXCLS16 0xfff5U /* maximum FAT16 clusters */
-#define MAXCLS32 0xffffff5U /* maximum FAT32 clusters */
+#define MINCLS16 0xff5U /* minimum FAT16 clusters */
+#define MINCLS32 0xfff5U /* minimum FAT32 clusters */
+#define MAXCLS12 0xff4U /* maximum FAT12 clusters */
+#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */
+#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */
#define mincls(fat) ((fat) == 12 ? MINCLS12 : \
(fat) == 16 ? MINCLS16 : \
OpenPOWER on IntegriCloud