summaryrefslogtreecommitdiff
path: root/usr.sbin/makefs/ffs.c
AgeCommit message (Collapse)Author
2023-01-07ufs: fixed signed/unsigned bugs affecting large file systemschs
Apply these commits from FreeBSD: commit e870d1e6f97cc73308c11c40684b775bcfa906a2 Author: Kirk McKusick <mckusick@FreeBSD.org> Date: Wed Feb 10 20:10:35 2010 +0000 This fix corrects a problem in the file system that treats large inode numbers as negative rather than unsigned. For a default (16K block) file system, this bug began to show up at a file system size above about 16Tb. To fully handle this problem, newfs must be updated to ensure that it will never create a filesystem with more than 2^32 inodes. That patch will be forthcoming soon. Reported by: Scott Burns, John Kilburg, Bruce Evans Followup by: Jeff Roberson PR: 133980 MFC after: 2 weeks commit 81479e688b0f643ffacd3f335b4b4bba460b769d Author: Kirk McKusick <mckusick@FreeBSD.org> Date: Thu Feb 11 18:14:53 2010 +0000 One last pass to get all the unsigned comparisons correct. In additional to the changes from FreeBSD, this commit includes quite a few related changes to appease -Wsign-compare.
2022-11-17Restore backward compatibility of UFS2 with previous NetBSD releases bychs
disabling support in UFS2 for extended attributes (including ACLs). Add a new variant of UFS2 called "UFS2ea" that does support extended attributes. Add new fsck_ffs operations "-c ea" and "-c no-ea" to convert file systems from UFS2 to UFS2ea and vice-versa (both of which delete all existing extended attributes in the process).
2022-04-09makefs(8): Nix trailing whitespace.riastradh
Computed by machine, eyeballed by hand, so to speak.
2022-04-06makefs: fix some typoswiz
2017-12-16PR/52828: Mark Johnston: makefs UFS2 lazy inode initialization is buggychristos
makefs(8) emulates UFS2 in performing lazy initialization of inode blocks when allocating and writing inodes. However, it only ever initializes one inode block at a time, which may be insufficient. If so, a later initialization may clobber an inode, resulting in an inconsistent filesystem. I committed a minimal fix for the problem to FreeBSD: https://svnweb.freebsd.org/changeset/base/326912
2017-02-08stampst.st_ion consistent treatment (non-zero vs zero instead of testing == 1)christos
2017-02-08no, this is wrong.christos
2017-02-08zero out the superblock so that it does not contain random stuff in thechristos
spare fields.
2015-12-21more deterministic ffs for reproducible builds.christos
2015-12-20Add timestamp support to the ffs image creation; needed for in kernel memorychristos
images MKREPRO.
2015-01-12PR/49559: Christian Brueffer: Fix typo maxbpf instead of maxbpg.christos
2013-06-23fsbtodb() -> FFS_FSBTODB(), EXT2_FSBTODB(), or MFS_FSBTODB()dholland
dbtofsb() -> FFS_DBTOFSB() or EXT2_DBTOFSB() (Christos already did the lfs ones a few days back)
2013-06-19Rename ambiguous macros:dholland
MAXDIRSIZE -> UFS_MAXDIRSIZE or LFS_MAXDIRSIZE NINDIR -> FFS_NINDIR, EXT2_NINDIR, LFS_NINDIR, or MFS_NINDIR INOPB -> FFS_INOPB, LFS_INOPB INOPF -> FFS_INOPF, LFS_INOPF blksize -> ffs_blksize, ext2_blksize, or lfs_blksize sblksize -> ffs_blksize These are not the only ambiguously defined filesystem macros, of course, there's a pile more. I may not have found all the ambiguous definitions of blksize(), too, as there are a lot of other things called 'blksize' in the system.
2013-06-09Stick UFS_ in front of these symbols:dholland
DIRBLKSIZ DIRECTSIZ DIRSIZ OLDDIRFMT NEWDIRFMT Part of PR 47909.
2013-02-03- more changes to make -O workchristos
- fix err* calls.
2013-01-30- don't abuse vp->fs to mean struct fs for ffs and struct msdos_opts;christos
make it always fsinfo_t and change void * to that. - kill unused structure members.
2013-01-30gc global sectorsize.christos
2013-01-29make everything use the generic options parser.christos
2013-01-28- use emalloc and friendschristos
- kill a bunch of global variables, more work to be done here - homogenize option parsing. more work for cd9660 - use the new options parsing code to print an fs-specific usage
2013-01-27This works well enough to populate plain files in the root dir. creatingchristos
directories fails.
2013-01-26make the buffer functions look exactly like the kernel ones and add otherchristos
cruft to make the kernel files compile.
2013-01-24- Fix single letter option parsing.christos
- Instead of returning 1 << index and 0 on error, return just index and -1 on error for the set_option*() routines.
2013-01-23return the bit of the option set, so that others can act on it.christos
2013-01-23remove duplicated code, and try to cleanup parsing by using the shared code.christos
cd9660 needs a lot of work.
2013-01-23- add support for parsing different types; not just int.christos
- add beginning of msdos support.
2013-01-22Stuff UFS_ in front of a few of ufs's symbols to reduce namespacedholland
pollution. Specifically: ROOTINO -> UFS_ROOTINO WINO -> UFS_WINO NXADDR -> UFS_NXADDR NDADDR -> UFS_NDADDR NIADDR -> UFS_NIADDR MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency) Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have the same values in ext2fs and ffs. No functional change intended.
2012-06-22Add -Z to enable sparse files - for ffs at least.sjg
Based on a patch from shesha at juniper.
2012-04-19WARNS=5christos
2012-01-28Patch from Jung-uk Kim (jkim at FreeBSD dot org) to allow contents of multiplechristos
directories to be merged to the current image.
2011-10-09add support for setting the ufs label. (Nathan Whitehorn)christos
2009-04-28Create images with 0666 - umask, not 0777 - umask (e.g. without x bits).joerg
2009-04-16Distinguish read(2) failure due to a short read from other causes, anddyoung
suggest in the error message a possible cause: the size= attribute in the metalog (if one is given) may be different from the source file's actual size.
2006-12-18from Anon Ymous: compile with -Wextrachristos
2006-10-22use c99 initializerschristos
2006-10-10implement -x by pruning fsnodes tree before building filesystem ratherdbj
than by skipping nodes while building filesystem
2006-04-22Coverity CID 174: Add extra NULL test to appease coverity.christos
2006-03-18free buf on error pathrtr
coverity 190 / run 5
2005-10-23Use the real field name (d_fileno instead of d_ino).thorpej
2005-08-20fix compilatio problems on LP64kent
2005-08-13Fix a sign warning for WARNS=3.fvdl
2005-06-02appease gcc -Wuninitializedlukem
2004-12-20Refactor the filesystem specific portions out of makefs.c/makefs.h completely.jmc
Instead of extending fsinfo_t it now holds a void * to file system specific data. This is then setup/cleaned up by the additional of 2 additional callbacks. Makes adding new filesystems simpler as almost no code has to be updated in the generic makefs code now.
2004-10-12Check for fstatvfs and provide/use it only if the host system has it.jmc
Fixes PR#27221
2004-07-24include <sys/statvfs.h> if HAVE_STRUCT_STATVFS_F_IOSIZEdbj
addresses part of PR toolchain/26415
2004-06-24Define FFS_MAXBSIZE to 65536 and use instead of MAXBSIZE.lukem
Deprecate unused MAXINOPB. Should fix PR [toolchain/25603].
2004-06-20Completely rework how tools/compat is done. Purge all uses/references tojmc
_NETBSD_SOURCE as this makes cross building from older/newer versions of NetBSD harder, not easier (and also makes the resulting tools 'different') Wrap all required code with the inclusion of nbtool_config.h, attempt to only use POSIX code in all places (or when reasonable test w. configure and provide definitions: ala u_int, etc). Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86 NetBSD current (x86 and amd64) and Solaris 9. Fixes PR's: PR#17762 PR#25944
2004-04-26Allow for ROOTINO when deciding whether their are enough inodes in thedsl
created filesystem. Otherwise this fails when asked for 63 inodes for i386 ramdisk-big. This code really needs to use the current version of newfs/mkfs.c where the actual inode count can be passed in (instead of the density). Fixes a build problem when I add /mountroot to mtree.common for sysinst.
2004-04-21Replace the statfs() family of system calls with statvfs().christos
Retain binary compatibility.
2004-04-02After populating the file system, update superblock->fs_old_cstotal fromlukem
superblock->fs_cstotal. Fixes inconsistencies found by FreeBSD's fsck. Problem noted by Luigi Rizzo <luigi@FreeBSD.org> via Colin Percival.
2003-10-26Mention that we should be adding space for bitmaps.mycroft