summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Some missed magic in the fsck wrapper commit which is required by otheradrian2000-10-093-632/+692
| | | | | | | | | | | | | utilities which use bits of fsck_ffs - namely quotacheck and fsdb. In depth, utilities.c contains blockcheck() which is needed by both, but also a slew of routines which require bits of the FFS code to be compiled in. This breaks the fs-specific and non-fs-specific code up into two files (well, blockcheck() is the only routine in utilities.c, that'll change later) which makes building fsck_ffs, quotacheck and fsdb work yet again. (You won't find commits to fsdb and quotacheck here before I haven't committed the post-fsck-wrappers version of them yet.)
* Reviewed by: rwatson, bpadrian2000-10-0911-224/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | Approved by: rwatson Obtained from: NetBSD-current source tree The beginnings of the fsck wrappers stuff from NetBSD. This particular commit brings a newly repo-copied sbin/fsck_ffs/ (from sbin/fsck/) into fsck wrappers mode. A quick overview (the code reflects this): * Documentation changed to reflect fsck_ffs instead of fsck * Simply acts on a single filesystem, doesn't try to do any multiple filesystem magic - this is done by the fsck wrappers now And then specific to fsck_ffs: * link to /sbin/fsck_4.2bsd and /sbin/fsck_ufs. This is because right now the filesystem is of type ufs not ffs, and that during autodetection the labeltype rather than the VFS type is used - this is because when doing an autodetection of filesystem type in the fsck wrapper program, it does not have any link between label type (4.2bsd, vinum, etc) and VFS string. Note that this shouldn't break a build since the required buildworld Makefile magic and import of the fsck wrapper code into src/sbin/fsck/ will happen in a seperate commit.
* Format string fix.kris2000-10-061-1/+1
|
* If the lost+found directory is created by fsck, it will do a cacheino()mckusick2000-07-241-1/+5
| | | | | | | | | | | | | | which sets the inoinfo's i_parent and i_dotdot to 0, but they never get set to ROOTINO. This means that propagate will never find lost+found and its descendents, subdirectories will remain DSTATE (instead of DFOUND) even though they *are* correctly linked in, and pass4.c will try to clear them unsuccessfully, thinking that there is no link count from the DSTATE directory's parent. The result is that you need to run fsck twice and get link count increasing errors (which are unexpected and fatal when running in preen mode). The fix is to set i_parent and i_dotdot to "parent" after the second cacheino() call in dir.c:allocdir(). Obtained from: "Ethan Solomita" <ethan@geocast.com> (of the NetBSD Project)
* Make a tighter test for valid inode numbers in getnextinode().mckusick2000-07-151-2/+3
|
* Ensure that block and character devices as well as fifo's and socketsmckusick2000-07-121-0/+6
| | | | | | | | | all have zero length. A non-zero length panic's the kernel when one of these is deleted. PR: 19426 Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Reviewed by: dwmalone@FreeBSD.org
* Teach fsck about snapshot files. These changes should have nomckusick2000-07-066-15/+121
| | | | | | | effect on operation of fsck on filesystems without snapshots. If you get compilation errors, be sure that you have copies of /usr/include/sys/mount.h (1.94), /usr/include/sys/stat.h (1.21), and /usr/include/ufs/ffs/fs.h (1.16) as of July 4, 2000 or later.
OpenPOWER on IntegriCloud