summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/setup.c
AgeCommit message (Collapse)Author
2007-06-01convert ufs2_daddr_t -> daddr64_t for greater clarity; ok pedro otto thibTheo de Raadt
2007-05-29Updated disklabel format to support larger disks and partitions. WeOtto Moerbeek
free room in struct partition by packing fragment size and fragments/block more tighlty and use the resulting space to make offset and size 48 bits. For the disk part we use spare fields in struct disklabel. Kernel converts in-mem copy of the on-disk label if needed, disklabel(8) writes new version. We are careful to only change fields not used by bootloaders. Conception of basic scheme by deraadt. ok deraadt@ krw@
2007-04-18When trying to read the primary superblock, do not accidentially readOtto Moerbeek
a ffs1 alternate sb at the primary ffs2 sb location. Use the same test as the kernel does. ok millert@ pedro@
2007-04-10Add support for checking ffs2 filesystems. From pedro@ based onTodd C. Miller
the ufs2 changes in FreeBSD by Kirk Mckusick.
2007-03-19be a tiny little bit more verbose when encoutering bad block or fragmentOtto Moerbeek
sizes; requested by mickey@
2007-03-19Add FFS2 fields to the superblock, change file system tools to keepPedro Martelletto
accessing FFS1 fields, okay art@, quite some testing by ckuethe@, simon@ and thib@, thanks.
2007-03-18there's no way we're going to be able to handle illegal block orOtto Moerbeek
fragment sizes, so just make those conditions fatal errors and tell the calling code to go look for alternate superblocks. ok millert@
2007-02-16Fix a row of bugs in the code that computes the alternate superblockOtto Moerbeek
locations based on the disklabel. - unit bug: disklabel size is in sectors, but superblock fs size is in fragments. - The disklabel contains the maximum superblock size, not the actual as used by newfs. - problem is that mkfs reduces track/sector and secors/track to make the cylindergroup fit in a fs block. In this case the values in the disklabel do not predict what's in the superblock. This fixes all these problems. It correctly predicts the location of all superblocks on all my filesystems I have online (sized between 100MB and 1000GB). Also tested with filesystems with different block and fragment sizes. Written this with a goto to make the diff easier to read. ok krw@ deraadt@
2007-02-13Do some extra validation of the superblock, otherwise a corruptOtto Moerbeek
superblock might lead to crashes or other mishap. Now my fuzzed fs images no longer crash fsck_ffs. ok mickey@ pedro@ millert@
2007-02-12max partition letter is 'a' + MAXPARTITIONS - 1, not 'h'. ok (andOtto Moerbeek
help) miod@
2007-02-09fix a fd leak that happens whe checking multiple file systems and someOtto Moerbeek
of them are clean. ok pedro@ millert@
2007-02-08Plug some mem leaks that occur when checking multiple file systems in aOtto Moerbeek
row. ok beck@ pedro@ millert@
2006-04-17prettier code; ok pedroTheo de Raadt
2006-03-09Remove option -n from newfs as well as all references to fs_postbl()Pedro Martelletto
Various testing for a while, okay krw@
2005-12-19Add and use a few more constants and macros needed by UFS2Pedro Martelletto
No functional change
2003-09-25whack commons as wanted by hoTheo de Raadt
2003-06-26const the rcsid, and make it say OpenBSDTed Unangst
2003-06-02Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-04-30only compare suberblock fields that are interesting, instead of trying toTed Unangst
ignore the noninteresting ones. will allow future changes to work with an older fsck. similar to changes in NetBSD and FreeBSD. ok krw@
2002-08-23- Convert function definitions to new styleGrigoriy Orlov
- eliminate trailing whitespace - remove casts that aren't needed. - make rcsid strings const, for -Wall compilation. from tedu <grendel@zeitbombe.org>
2002-06-09rm trailing whitespaceTodd T. Fries
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-11-05kill more registers;Mike Pechkin
millert@ ok
2001-07-07major -Wall cleanup, almost completeTheo de Raadt
2001-05-15report on another calloc() failureTheo de Raadt
2001-04-19Cleanup dirpref and synhronize superblock with freebsd.Grigoriy Orlov
From FreeBSD with little changes. art@ ok.
2001-04-13Fix overflow in superblock. From FreeBSD.Grigoriy Orlov
FreeBSD's log: > The ffs superblock includes a 128-byte region for use by temporary > in-core pointers to summary information. An array in this region > (fs_csp) could overflow on filesystems with a very large number of > cylinder groups (~16000 on i386 with 8k blocks). When this happens, > other fields in the superblock get corrupted, and fsck refuses to > check the filesystem. > > Solve this problem by replacing the fs_csp array in 'struct fs' > with a single pointer, and add padding to keep the length of the > 128-byte region fixed. Update the kernel and userland utilities > to use just this single pointer. > > With this change, the kernel no longer makes use of the superblock > fields 'fs_csshift' and 'fs_csmask'. Add a comment to newfs/mkfs.c > to indicate that these fields must be calculated for compatibility > with older kernels. art@ ok.
2001-04-06Replace FFS directory preference algorithm(dirpref) by new one.Grigoriy Orlov
It allocates directory inode in the same cylinder group as a parent directory in. This speedup file/directory intensive operations on a big file systems in times. Don't forget to recompile fsck_ffs with updated fs.h or you will get "VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE" at the next boot. In any case you can ignore this error safely. Requested by deraadt@
2001-03-02Make fsck aware of soft updates.Artur Grabowski
We had this in the tree 1997, but it went away because it was too close to release. Ok: csapuntz@ (as a size note: It's really good to test fsck when you are torture testing the filesystems)
1999-08-17More <sys/file.h> vs. <fcntl.h> and open() flags fixes.Todd C. Miller
1997-10-06back out vfs lite2 till after 2.2Theo de Raadt
1997-10-06VFS Lite2 ChangesConstantine Sapuntzakis
1996-10-20Sync with NetBSD 961019Thorsten Lockert
1996-06-23update rcsidTheo de Raadt
1996-05-28be more carefulTheo de Raadt
1995-10-18initial import of NetBSD treeTheo de Raadt