Commit Graph

8 Commits

Author SHA1 Message Date
Warner Losh
bf0d940a2f 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
2016-08-30 18:01:26 +00:00
Warner Losh
4a9fb9fb80 Remove CHS alignment. It's not needed and causes problems for the BBB
boot partition. NetBSD removed it in 1.10 in their repo some time ago.

Submitted by: Guy Yur
PR: 183234
2016-08-30 18:01:19 +00:00
Marcelo Araujo
564500def9 Use nitems() from sys/param.h.
MFC after:	2 weeks.
2016-04-19 04:57:57 +00:00
Enji Cooper
170b1dd53e Fix leak in mkfs_msdos(..) by initializing img to NULL and free'ing at the end
of the function

Differential Revision: https://reviews.freebsd.org/D4405
MFC after: 1 week
PR: 204943
Reviewed by: emaste, jilles
Reported by: David Binderman <dcb314@hotmail.com>
Sponsored by: EMC / Isilon Storage Division
2015-12-06 21:07:33 +00:00
Ed Maste
937744df07 mkfs_msdos: sync with NetBSD
Add a sanity test and clean up whitespace.

Obtained from:	NetBSD
2015-11-27 14:20:32 +00:00
Ed Maste
99f4158c82 newfs_msdos: rework error handling for eventual use in makefs
Return -1 on errors from mkfs_msdos() instead of err()/errx(), to
allow different consumers to handle errors as appropriate.

Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2015-11-23 18:58:00 +00:00
Ed Maste
59faa1e9fb newfs_msdos: prefer snprintf to sprintf
Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2015-10-16 15:19:36 +00:00
Ed Maste
041b03daab newfs_msdos: move mkfs_msdos to separate file for later use in makefs
Sponsored by:	The FreeBSD Foundation
2015-10-15 19:00:33 +00:00