summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Yesterday I had to fix a badly broken disk, and found that fsck kept dying:mckusick2000-02-283-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DIR I=64512 CONNECTED. PARENT WAS I=4032 fsck: cannot find inode 995904 fsdb found the inodes with no problem: fsdb (inum: 64512)> inode 995904 current inode: directory I=995904 MODE=40777 SIZE=512 MTIME=Feb 14 15:27:07 2000 [0 nsec] CTIME=Feb 14 15:27:07 2000 [0 nsec] ATIME=Feb 24 10:31:58 2000 [0 nsec] OWNER=nobody GRP=nobody LINKCNT=4 FLAGS=0 BLKCNT=2 GEN=38a41386 Direct blocks: 8094568 0 0 0 0 0 0 0 0 0 0 0 Indirect blocks: 0 0 0 The problem turns out to be a program logic error in fsck. It stores directory inodes internally in hash lists, using the number of directories to form the hash key: inpp = &inphead[inumber % numdirs]; Elsewhere, however, it increments numdirs when it finds unattached directories. I've made the following fix, which solved the problem in the case in hand. Submitted by: Greg Lehey <grog@lemis.com> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Approved by: Kirk McKusick <mckusick@mckusick.com>
* Fix the use of an uninitialized variable in the previous commit.peter2000-01-101-2/+2
| | | | | | | Also, in addition to the previous log message, the last change had a fix for the case where where f.mntfromname is a relative path like da0a. Submitted by: bde
* - Style/bde changes.peter2000-01-101-32/+38
| | | | | | | | | | - Don't use realpath as stat does the right thing. - Only check ufs filesystems in getmntpt. - Dont' bother checking that the ufs-mounted-on device is a special file. It *must* be a special file, or ufs wouldn't have mounted it. Submitted by: Paul Saab <ps@yahoo-inc.com>
* - Forgot to nuke hotroot completely.peter2000-01-101-1/+1
| | | | Submitted by: Paul Saab <ps@yahoo-inc.com>
* Make fsck(8) do a MNT_RELOAD after cleaning for all read-only mountedpeter1999-12-302-35/+63
| | | | | | | filesystems, not just for the root fs. Reviewed by: mckusick Submitted by: Paul Saab <ps@yahoo-inc.com>
* Make fsck even more char/blk dev tolerant.phk1999-11-272-18/+11
|
* Allow root-reloading also for chr devices.phk1999-11-271-44/+3
|
* $Id$ -> $FreeBSD$peter1999-08-2813-13/+13
|
* Also check against chardevs when looking for root.phk1999-07-201-1/+3
|
* Cosmetic and documentation changes brought from earlier FreeBSD versions.julian1998-12-0313-32/+91
| | | | (e.g. RCS Id:)
* Reviewed by: Don Lewis <Don.Lewis@tsc.tdk.com>julian1998-12-0314-379/+556
| | | | | | | | | | | | Submitted by: Kirk McKusick <mckusick@McKusick.COM> Obtained from: Mckusick, BSDI and a host of others This exactly matches Kirks sources imported under the Tag MCKUSICK2. These are as supplied by kirk with one small change needed to compile under freeBSD. Some FreeBSD patches will be added back, though many have been added to Kirk's sources already.
* For large filesystems you can run past default resource limits causingmjacob1998-11-051-1/+7
| | | | | | | fsck to exit unhappily. Fix this by doing a getrlimit/setrlimit for RLIMIT_DATA. I made the same fix in NetBSD. Reviewed by: dg@root.com
* - Back out softupdate change that already existed in FreeBSD from V1.6,nate1998-09-231-3/+1
| | | | | | | | | which caused the reference count of a directory to get doubly decremented. PR: bin/8030 Reviewed by: nate Submitted by: Don Lewis <Don.Lewis@tsc.tdk.com>
* Use explicitly sized types when laying out the cylinder groups. Thisdfr1998-08-151-6/+6
| | | | | | bug was the cause of the 'freeing free frag' panics that people have been seeing with FreeBSD/alpha. I have a similar patch to newfs but I've not finished testing it.
* There seem to be two messages that were added with soft-updatesphk1998-08-041-3/+3
| | | | | | | | | | | support, which need a final "\n". I only observed one line of mangled output, but I think there is another one which suffers from the same problem, and thus I provide a patch that covers both. PR: 7483 Reviewed by: phk Submitted by: Stefan Esser <se@FreeBSD.org>
* Avoid trying to malloc > (1<<32) bytes of memory due to an arithmeticdfr1998-08-011-2/+2
| | | | underflow on the alpha.
* Restored rev.1.11, which I somehow clobbered in rev.1.12.bde1998-07-061-1/+4
|
* Fixed printf format errors.bde1998-06-285-21/+22
|
* Correct use of .Nm. Add rcsid. Remove unused #includes. Use err(3).charnier1998-06-1513-60/+79
|
* Reviewed by: Kirk Mckusick (mckusick@mckusick.com)julian1998-06-051-1/+1
| | | | | | Submitted by: luoqi Chen fix a type in fsck. (also add a comment that got picked up by mistake but is worth adding)
* Guess the position of the drive number in the device name better sobde1998-04-071-6/+7
| | | | | | | | | | | that `fsck -p' doesn't check multiple slices on the same drive concurrently. Don't invoke undefined behaviour when searching for the drive number in strange device names. PR: 6129 Reviewed by: phk Submitted by: Yuichi MATSUTAKA <matutaka@osa.att.ne.jp>, but rewritten by me.
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-089-48/+152
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* If numdirs is zero, print a helpful message instead of divding by zero later.phk1998-03-041-0/+4
|
* opt_diagnostic.h isn't needed anymore.jhay1998-02-061-7/+2
|
OpenPOWER on IntegriCloud