aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_ifs
Commit message (Collapse)AuthorAgeFilesLines
* Remove IFS from 5.0-CURRENT. This facilitates introducing UFS2 asRobert Watson2002-05-1916-5674/+0
| | | | | | | | | | | IFS had its fingers deep in the belly of the UFS/FFS split. IFS will be reimplemented by the maintainer at a later date once the UFS implementation is in place. Requested by: adrian (maintainer) Notes: svn path=/head/; revision=96884
* more file system > filesystemTom Rhodes2002-05-163-11/+11
| | | | Notes: svn path=/head/; revision=96707
* Retire the bogus uses of the disklabel field d_sbsize and begin toPoul-Henning Kamp2002-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. Notes: svn path=/head/; revision=96475
* Usage style sweep: spell "usage" with a small 'u'.Dag-Erling Smørgrav2002-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}/. Notes: svn path=/head/; revision=95258
* Replace __progname with the documented, more acceptable and functionally ↵Mark Murray2002-03-241-5/+5
| | | | | | | identical getprogname(3). Notes: svn path=/head/; revision=93103
* o __P removedWarner Losh2002-03-2014-326/+169
| | | | | | | | | | o ansi function prototypes o unifdef -D__STDC__ o __dead2 on usage prototype o remove now-bogus main prototype Notes: svn path=/head/; revision=92839
* Remove 'register' keyword.David E. O'Brien2002-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?) Notes: svn path=/head/; revision=92806
* SpellingPhilippe Charnier2001-12-111-1/+1
| | | | Notes: svn path=/head/; revision=87667
* Default to WARNS=2.David E. O'Brien2001-12-041-1/+2
| | | | | | | | | Binary builds that cannot handle this must explicitly set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87325
* Silence non-constant format string warnings by marking functionsKris Kennaway2001-08-192-4/+4
| | | | | | | | | | as __printflike()/__printf0like(), adding const, or adding missing "%s" format strings, as appropriate. MFC after: 2 weeks Notes: svn path=/head/; revision=81911
* Remove whitespace at EOL.Dima Dorfman2001-07-151-12/+12
| | | | Notes: svn path=/head/; revision=79754
* mdoc(7) police: removed HISTORY info from the .Os call.Ruslan Ermilov2001-07-101-1/+1
| | | | Notes: svn path=/head/; revision=79530
* Add support for -F flag (trivial as background check is never possible).Kirk McKusick2001-04-251-1/+6
| | | | Notes: svn path=/head/; revision=75980
* mdoc(7) police: prepare for mdocNG.Ruslan Ermilov2001-04-161-1/+1
| | | | Notes: svn path=/head/; revision=75545
* Quoting from the email thrown around between kirk, bde and iedowse@..Adrian Chadd2001-03-311-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | <QUOTE> Overflow of cg_niblk causes spurious "SUMMARY INFORMATION BAD" warnings prompts in fsck_ffs. cg_niblk has type int16_t, but it is (ab)used to hold the number of inodes per group (it has nothing to do with the number of inode blocks in the cg as claimed in ffs/fs.h), and there can be lots of inodes per group. E.g., newfs -i 8192 -b 16384 -f 16384 -c 255 ... gives 0xA900 inodes/group. Assignment of this to cg_niblk gives -0x5700. This is mostly harmless (ufs/ffs doesn't use cg_niblk, and bug-for-bug compatible overflow occurs in newfs), but in fsck_ffs/pass5.c, negative values of cg_niblk limit cg_irotor to 0 and the summary info appears to be bad. </QUOTE> Submitted by: Bruce Evans <bde@zeta.org.au> Obtained from: Kirk McKusick <mckusick@mckusick.com> Notes: svn path=/head/; revision=75037
* The ffs superblock includes a 128-byte region for use by temporaryIan Dowse2001-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 Notes: svn path=/head/; revision=71073
* Prepare for mdoc(7)NG.Ruslan Ermilov2000-12-181-4/+5
| | | | Notes: svn path=/head/; revision=70152
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-5/+5
| | | | Notes: svn path=/head/; revision=68960
* Pre-IFS commit. Commit IFS-aware fsck and mount utilities.Adrian Chadd2000-10-144-7/+13
| | | | | | | | | | | | | | | | | | | | | | mount_ifs: repocopy of sbin/mount, with most of the intelligence ripped out and "ufs" replaced with "ifs" in the right places. It will only mount a single filesystem, rather than the -t <type> magic that our real mount does. fsck_ifs: repocopy of sbin/fsck_ffs, but the directory structure stuff (pass2 and some refcount checks) has been #ifdef'ed out. src/sbin/Makefile: Build these two utilities There is probably cruft code left in both which can be removed at a later date, especially in mount_ifs, but I trust that people will not try mount_ifs -a .. Note: there are no man pages installed for these two commands as I haven't actually written them yet. Notes: svn path=/head/; revision=67105
* .. forgot a ; at the end of the $FreeBSD$ string. How did I actually forgetAdrian Chadd2000-10-091-1/+1
| | | | | | | | | this? :-) It builds again. Notes: svn path=/head/; revision=66866
* Some missed magic in the fsck wrapper commit which is required by otherAdrian Chadd2000-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.) Notes: svn path=/head/; revision=66864
* Reviewed by: rwatson, bpAdrian Chadd2000-10-095-93/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=66861
* Format string fix.Kris Kennaway2000-10-061-1/+1
| | | | Notes: svn path=/head/; revision=66773
* If the lost+found directory is created by fsck, it will do a cacheino()Kirk 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) Notes: svn path=/head/; revision=63810
* Make a tighter test for valid inode numbers in getnextinode().Kirk McKusick2000-07-151-2/+3
| | | | Notes: svn path=/head/; revision=63231
* Ensure that block and character devices as well as fifo's and socketsKirk McKusick2000-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 Notes: svn path=/head/; revision=63003
* Teach fsck about snapshot files. These changes should have noKirk McKusick2000-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. Notes: svn path=/head/; revision=62668
* Yesterday I had to fix a badly broken disk, and found that fsck kept dying:Kirk 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> Notes: svn path=/head/; revision=57573
* Fix the use of an uninitialized variable in the previous commit.Peter Wemm2000-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 Notes: svn path=/head/; revision=55773
* - Style/bde changes.Peter Wemm2000-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> Notes: svn path=/head/; revision=55725
* - Forgot to nuke hotroot completely.Peter Wemm2000-01-101-1/+1
| | | | | | | Submitted by: Paul Saab <ps@yahoo-inc.com> Notes: svn path=/head/; revision=55724
* Make fsck(8) do a MNT_RELOAD after cleaning for all read-only mountedPeter Wemm1999-12-302-35/+63
| | | | | | | | | | filesystems, not just for the root fs. Reviewed by: mckusick Submitted by: Paul Saab <ps@yahoo-inc.com> Notes: svn path=/head/; revision=55275
* Make fsck even more char/blk dev tolerant.Poul-Henning Kamp1999-11-272-18/+11
| | | | Notes: svn path=/head/; revision=53781
* Allow root-reloading also for chr devices.Poul-Henning Kamp1999-11-271-44/+3
| | | | Notes: svn path=/head/; revision=53754
* $Id$ -> $FreeBSD$Peter Wemm1999-08-2813-13/+13
| | | | Notes: svn path=/head/; revision=50476
* Also check against chardevs when looking for root.Poul-Henning Kamp1999-07-201-1/+3
| | | | Notes: svn path=/head/; revision=48935
* Cosmetic and documentation changes brought from earlier FreeBSD versions.Julian Elischer1998-12-0313-32/+91
| | | | | | | (e.g. RCS Id:) Notes: svn path=/head/; revision=41477
* Reviewed by: Don Lewis <Don.Lewis@tsc.tdk.com>Julian Elischer1998-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. Notes: svn path=/head/; revision=41474
* For large filesystems you can run past default resource limits causingMatt Jacob1998-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 Notes: svn path=/head/; revision=40918
* - Back out softupdate change that already existed in FreeBSD from V1.6,Nate Williams1998-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> Notes: svn path=/head/; revision=39584
* Use explicitly sized types when laying out the cylinder groups. ThisDoug Rabson1998-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. Notes: svn path=/head/; revision=38328
* There seem to be two messages that were added with soft-updatesPoul-Henning Kamp1998-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> Notes: svn path=/head/; revision=38067
* Avoid trying to malloc > (1<<32) bytes of memory due to an arithmeticDoug Rabson1998-08-011-2/+2
| | | | | | | underflow on the alpha. Notes: svn path=/head/; revision=38002
* Restored rev.1.11, which I somehow clobbered in rev.1.12.Bruce Evans1998-07-061-1/+4
| | | | Notes: svn path=/head/; revision=37443
* Fixed printf format errors.Bruce Evans1998-06-285-21/+22
| | | | Notes: svn path=/head/; revision=37236
* Correct use of .Nm. Add rcsid. Remove unused #includes. Use err(3).Philippe Charnier1998-06-1513-60/+79
| | | | Notes: svn path=/head/; revision=37000
* Reviewed by: Kirk Mckusick (mckusick@mckusick.com)Julian Elischer1998-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) Notes: svn path=/head/; revision=36681
* Guess the position of the drive number in the device name better soBruce Evans1998-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. Notes: svn path=/head/; revision=35095
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)Julian Elischer1998-03-089-48/+152
| | | | | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree Notes: svn path=/head/; revision=34266
* If numdirs is zero, print a helpful message instead of divding by zero later.Poul-Henning Kamp1998-03-041-0/+4
| | | | Notes: svn path=/head/; revision=34033