summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bunch of format string warnings which brokemux2002-07-316-35/+43
| | | | | | the sparc64 build. Tested on: sparc64, i386
* Remove some additional paranoia which Kirk forgot to remove from hisphk2002-07-302-4/+2
| | | | | | | | | | | | | UFS2 commit. These bits in essence made any instance of "softupdates expected corrution", (ie blocks marked allocated but not referenced by an inode etc) result in a exit value for fsck_ffs of 2. 2 is part of the magic and appearantly undocumented protocol between fsck_FOO and fsck and means "dump into single user mode ASAP. Sponsored by: DARPA & NAI Labs.
* Warning cleanup.phk2002-07-3010-71/+71
| | | | Format changes by peter
* Remove the kernel file-size limit for UFS2, so that only the limitiedowse2002-06-261-1/+4
| | | | | | | | | | imposed by the filesystem structure itself remains. With 16k blocks, the maximum file size is now just over 128TB. For now, the UFS1 file size limit is left unchanged so as to remain consistent with RELENG_4, but it too could be removed in the future. Reviewed by: mckusick
* Fix an integer overflow that causes fsck_ffs to crash when itiedowse2002-06-261-1/+1
| | | | | | encounters very large file sizes in the filesystem. Reviewed by: mckusick
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-2111-374/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem expands the inode to 256 bytes to make space for 64-bit block pointers. It also adds a file-creation time field, an ability to use jumbo blocks per inode to allow extent like pointer density, and space for extended attributes (up to twice the filesystem block size worth of attributes, e.g., on a 16K filesystem, there is space for 32K of attributes). UFS2 fully supports and runs existing UFS1 filesystems. New filesystems built using newfs can be built in either UFS1 or UFS2 format using the -O option. In this commit UFS1 is the default format, so if you want to build UFS2 format filesystems, you must specify -O 2. This default will be changed to UFS2 when UFS2 proves itself to be stable. In this commit the boot code for reading UFS2 filesystems is not compiled (see /sys/boot/common/ufsread.c) as there is insufficient space in the boot block. Once the size of the boot block is increased, this code can be defined. Things to note: the definition of SBSIZE has changed to SBLOCKSIZE. The header file <ufs/ufs/dinode.h> must be included before <ufs/ffs/fs.h> so as to get the definitions of ufs2_daddr_t and ufs_lbn_t. Still TODO: Verify that the first level bootstraps work for all the architectures. Convert the utility ffsinfo to understand UFS2 and test growfs. Add support for the extended attribute storage. Update soft updates to ensure integrity of extended attribute storage. Switch the current extended attribute interfaces to use the extended attribute storage. Add the extent like functionality (framework is there, but is currently never used). Sponsored by: DARPA & NAI Labs. Reviewed by: Poul-Henning Kamp <phk@freebsd.org>
* more file system > filesystemtrhodes2002-05-168-187/+187
|
* UFS2 preparation commit:phk2002-05-128-221/+27
| | | | | | | Remove support for converting old FFS formats to newer. Submitted by: mckusick Sponspored by: DARPA & NAI Labs.
* Retire the bogus uses of the disklabel field d_sbsize and begin tophk2002-05-122-3/+1
| | | | | | | initialize it to zero so we don't have to have everbody and their aunt including FFS specific header files. Sponsored by: DARPA & NAI Labs.
* Minor bug fixes uncovered while working on UFS2.mckusick2002-05-022-2/+2
| | | | They should have no effect on existing systems.
* Usage style sweep: spell "usage" with a small 'u'.des2002-04-221-1/+1
| | | | | Also change one case of blatant __progname abuse (several more remain) This commit does not touch anything in src/{contrib,crypto,gnu}/.
* When checking the alternate superblock, we used to copy any fieldsmckusick2002-04-071-61/+25
| | | | | | | | | | | | | | that might have changed, then did a byte-by-byte comparison with the alternate. If any unused fields got used, they had to be added to the exception list. Such changes caused too many false alarms. So, I have changed the comparison algorithm to compare a selected set of fields that are not expected to change. This new algorithm causes far fewer false hits and still does a good job of detecting problems when they have really occurred. In particular, this change should ease the transition to kernels supporting UFS2 which make some significant changes to the superblock. Sponsored by: DARPA, NAI Labs
* Replace __progname with the documented, more acceptable and functionally ↵markm2002-03-241-5/+4
| | | | identical getprogname(3).
* o __P removedimp2002-03-2014-336/+181
| | | | | | | o ansi function prototypes o unifdef -D__STDC__ o __dead2 on usage prototype o remove now-bogus main prototype
* Remove 'register' keyword.obrien2002-03-2010-71/+71
| | | | | | It does not help modern compilers, and some may take some hit from it. (I also found several functions that listed *every* of its 10 local vars with "register" -- just how many free registers do people think machines have?)
* declare locally used globals as static.alfred2001-12-221-3/+3
|
* Ignore the value of fs_active when comparing superblocks.iedowse2001-12-171-0/+1
| | | | Noticed by: "Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
* Spellingcharnier2001-12-111-1/+1
|
* mdoc(7) police: section 1 and 8 manpages document their exitru2001-12-041-4/+2
| | | | | codes under the DIAGNOSTICS section, not RETURN VALUES, which is for section 2, 3, and 9 manpages.
* Actually I haven't enumerated the return values yet (thats why I hadn'tobrien2001-12-041-1/+1
| | | | | committed it yet). So vague'ize the wording a little bit to make up for it.
* Default to WARNS=2.obrien2001-12-042-1/+6
| | | | | | Binary builds that cannot handle this must explicitly set WARNS=0. Reviewed by: mike
* Fix a large number of -Wall, -Wformat and -W compiler warnings.iedowse2001-11-1711-59/+50
| | | | | | | | | These were mainly missing casts or wrong format strings in printf statements, but there were also missing includes, unused variables, functions and arguments. The choice of `long' vs `int' still seems almost random in a lot of places though.
* Give a more useful diagnostic when an extraneous hard link to aiedowse2001-11-171-1/+3
| | | | | | | | | | directory is encountered. This includes the full path of the directory that will be removed if the user answers "y" to the "REMOVE?" question. PR: bin/226851 Submitted by: KOIE Hide <hide@koie.org> MFC after: 1 week
* Silence non-constant format string warnings by marking functionskris2001-08-193-5/+5
| | | | | | | as __printflike()/__printf0like(), adding const, or adding missing "%s" format strings, as appropriate. MFC after: 2 weeks
* Remove whitespace at EOL.dd2001-07-151-11/+11
|
* Ignore the new superblock fields fs_pendingblocks and fs_pendinginodesiedowse2001-05-291-0/+2
| | | | | | | when comparing with the alternate superblock. These fields are used for temporary in-core information only. This should fix the "VALUES IN SUPER BLOCK DISAGREE WITH THOSE IN FIRST ALTERNATE" error from fsck_ffs that has been seen a lot recently.
* Just notify us once when encountering a partially allocated inode.mckusick2001-05-081-1/+1
|
* Update usage message with new options.mckusick2001-04-301-1/+1
| | | | Submitted by: Ruslan Ermilov <ru@FreeBSD.org>
* mdoc(7) police:ru2001-04-271-3/+3
| | | | document date updated, removed history info from the .Os call, cosmetics.
* Add support for the -F flag which determines whether a specifiedmckusick2001-04-245-83/+117
| | | | | | | | | | | | filesystem needs foreground checking (usually at boot time) or can defer to background checking (after the system is up and running). See the manual page, fsck_ffs(8), for details on the -F and -B options. These options are primarily intended for use by the fsck front end. All output is directed to stdout so that the output is coherent when redirected to a file or a pipe. Unify the code with the fsck front end that allows either a device or a mount point to be specified as the argument to be checked.
* In fsdb, call sblock_init() which is now necessary to initialiseiedowse2001-04-232-0/+2
| | | | | the global variable dev_bsize. Add a prototype for sblock_init() to fsck.h, and set the return type correctly.
* Minor background cleanups:mckusick2001-04-165-30/+87
| | | | | | | | | | | 1) Set the FS_NEEDSFSCK flag when unexpected problems are encountered. 2) Clear the FS_NEEDSFSCK flag after a successful foreground cleanup. 3) Refuse to run in background when the FS_NEEDSFSCK flag is set. 4) Avoid taking and removing a snapshot when the filesystem is already clean. 5) Properly implement the force cleaning (-f) flag when in preen mode. Note that you need to have revision 1.21 (date: 2001/04/14 05:26:28) of fs.h installed in <ufs/ffs/fs.h> defining FS_NEEDSFSCK for this to compile.
* mdoc(7) police: prepare for mdocNG.ru2001-04-161-1/+1
|
* Catch up to the dirpref changes by copying new fields in the alternatejhb2001-04-101-0/+3
| | | | | superblock from the original superblock so that differences in those new fields are ignored.
* Use fs->fs_ipg rather than cg->cg_niblk as the latter is onlymckusick2001-03-311-1/+1
| | | | | | 16-bits and may overflow. Obtained from: Bruce Evans <bde@zeta.org.au>
* - Backout botched attempt to introduce MANSECT feature.ru2001-03-261-0/+1
| | | | - MAN[1-9] -> MAN.
* Additions to run checks on live filesystems. This change will notmckusick2001-03-2111-168/+398
| | | | | | | | | affect current systems until fsck is modified to use these new facilities. To try out this change, set the fsck passno to zero in /etc/fstab to cause the filesystem to be mounted without running fsck, then run `fsck_ffs -p -B <filesystem>' after the system has been brought up multiuser to run a background cleanup on <filesystem>. Note that the <filesystem> in question must have soft updates enabled.
* Set the default manual section for sbin/ to 8.ru2001-03-201-1/+0
|
* Preceed/preceeding are not english words. Use precede or preceding.asmodai2001-02-181-1/+1
|
* Don't allow special devices of type NODEV (NOUDEV as seen from kernel).tegge2001-02-151-0/+5
| | | | | | They can't be created via mknod and the kernel crashes if it encounters such an inode. Approved by: mckusick
* Use ".Nm fsck_ffs", so that this turns up in whatis(1), and others.nik2001-02-121-2/+4
| | | | | | | Add .Xr to fsck. Prompted by: JM Jr's script that shows binaries with no whatis info Reviewed by: adrian
* Fsck_ffs did not properly range-check the inode 'di_size'iedowse2001-01-312-3/+8
| | | | | | | | | | | | | | | | | | | field, so it was possible for a filesystem marked clean by fsck_ffs to cause kernel crashes later when mounted. This could occur when fsck_ffs was used to repair a badly corrupted filesystem. As pointed out by bde, it is not sufficient to restrict di_size to just the superblock fs_maxfilesize limit. The use of 32-bit logical block numbers (both in fsck and the kernel) induces another file size limit which is usually lower than fs_maxfilesize. Also, the old 4.3BSD filesystem does not have fs_maxfilesize initialised. Following this change, fsck_ffs will enforce exactly the same file size limits as are used by the kernel. PR: kern/15065 Discussed with: bde Reviewed by: bde, mckusick
* The ffs superblock includes a 128-byte region for use by temporaryiedowse2001-01-152-4/+5
| | | | | | | | | | | | | | | | | | | | 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. Reviewed by: mckusick
* Document fsck_ffs's new SIGINFO handler.iedowse2001-01-031-0/+12
| | | | Reviewed by: sheldonh
* Add a missing period and newline to a message.phk2000-12-181-1/+2
| | | | | PR: 23334 Submitted by: Rich Morin <rdm@cfcl.com>
* Prepare for mdoc(7)NG.ru2000-12-181-4/+5
|
* Add a simple SIGINFO handler to fsck_ffs. Shortly after receipt ofiedowse2000-12-159-0/+47
| | | | | | | | a SIGINFO (normally via Ctrl-T), a line will be output indicating the current phase number and progress information relevant to the current phase. Approved by: mckusick
* added growfs(8) including ffsinfo(8) to the freebsd base systemtomsoft2000-12-091-1/+5
| | | | Reviewed by: grog
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-5/+5
|
* .. forgot a ; at the end of the $FreeBSD$ string. How did I actually forgetadrian2000-10-091-1/+1
| | | | | | this? :-) It builds again.
OpenPOWER on IntegriCloud