summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Add the -R option to allow fsck_ffs to restart itself when too many criticalscottl2013-12-301-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | errors have been detected in a particular run. Clean up the global state variables so that a restart can happen correctly. Separate the global variables in fsck_ffs and fsdb to their own file. This fixes header sharing with fscd. Correctly initialize, static-ize, and remove global variables as needed in dir.c. This fixes a problem with lost+found directories that was causing a segfault. Correctly initialize, static-ize, and remove global variables as needed in suj.c. Initialize the suj globals before allocating the disk object, not after. Also ensure that 'preen' mode doesn't conflict with 'restart' mode Submitted by: scottl, max Reviewed by: max, mckusick (earlier version) Obtained from: Netflix MFC after: 3 days
* When running with the -d option, instrument fsck_ffs to track the number,mckusick2013-02-241-1/+1
| | | | | | data type, and running time of its I/O operations. No functional changes.
* Fix the check in dircheck() on namlen.delphij2011-09-021-2/+2
| | | | | | | | | | | | | | The value of namlen is copied from on-disk d_namlen, which is a 8-bit unsigned integer which can never exceed MAXNAMLEN (255) so the test is always true. Moreover, UFS does not allow d_namelen being zero. Change namlen from u_int to u_int8_t, and replace the unneeded test with a useful test. PR: bin/160339 Submitted by: Eugene Grosbein <eugen grosbein.pp.ru> MFC after: 2 weeks Approved by: re (kib)
* Eliminate linked list used to track inodes with an initial linktruckman2004-10-081-3/+2
| | | | | | | | | count of zero and instead encode this information in the inode state. Pass 4 performed a linear search of this list for each inode in the file system, which performs poorly if the list is long. Reviewed by: sam & keramida (an earlier version of the patch), mckusick MFC after: 1 month
* Create DIP_SET() and IBLK_SET() macros to fix lvalue warnings.scottl2004-09-011-14/+14
| | | | Inspired by: kan
* Remove advertising clause from University of California Regent's license,markm2004-04-091-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core, imp
* Change the default mode for lost+found from 01777 to 0700. Theiedowse2003-10-191-1/+1
| | | | | | | | | | original intention of the less restrictive permissions was to allow users to move or delete recovered files that they own. However, it is better to not create world-writable directories by default; the administrator can always pre-create lost+found if different permissions are desired. Reviewed by: mckusick
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-031-6/+7
|
* s/filesystem/file system/g as discussed on -developerstrhodes2002-08-211-2/+2
|
* Warning cleanup.phk2002-07-301-10/+11
| | | | Format changes by peter
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-211-42/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* UFS2 preparation commit:phk2002-05-121-61/+6
| | | | | | | Remove support for converting old FFS formats to newer. Submitted by: mckusick Sponspored by: DARPA & NAI Labs.
* o __P removedimp2002-03-201-54/+25
| | | | | | | o ansi function prototypes o unifdef -D__STDC__ o __dead2 on usage prototype o remove now-bogus main prototype
* Remove 'register' keyword.obrien2002-03-201-19/+19
| | | | | | 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?)
* Fix a large number of -Wall, -Wformat and -W compiler warnings.iedowse2001-11-171-2/+2
| | | | | | | | | 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.
* Additions to run checks on live filesystems. This change will notmckusick2001-03-211-5/+24
| | | | | | | | | 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.
* 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)
* Teach fsck about snapshot files. These changes should have nomckusick2000-07-061-4/+10
| | | | | | | 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.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Cosmetic and documentation changes brought from earlier FreeBSD versions.julian1998-12-031-0/+11
| | | | (e.g. RCS Id:)
* Reviewed by: Don Lewis <Don.Lewis@tsc.tdk.com>julian1998-12-031-38/+58
| | | | | | | | | | | | 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.
* - 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>
* Fixed printf format errors.bde1998-06-281-2/+2
|
* Correct use of .Nm. Add rcsid. Remove unused #includes. Use err(3).charnier1998-06-151-1/+4
|
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-081-3/+6
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* Finished (?) merging with Lite2: cleaned up #include mess.bde1997-03-121-3/+2
| | | | Fixed misformatting in a comment.
* Merge from Lite2. Note that Lite2 has it's own filesystem clean checkpeter1997-03-111-64/+79
| | | | | skipping code that overrides ours sooner. One should be eliminated, but for now it works.
* From: Terry Lambert <terry@lambert.org>nate1996-05-091-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Subject: Fix for annoying fsck bug Date: Wed, 24 Jan 1996 13:33:29 -0700 (MST) The following small diff fixes the annoying fsck bug that causes it to need to be run twice to end up with correct reference counts for inodes for directories that had subdirectories relocated into the lost+found directory. I found the need to rerun *extremely* annoying. This fix causes the count to be correctly adjusted later in pass 4 by correctly stating the parent reference count. Note that the parent reference count is incremented when the directory entry is made (for ".."), but is not really there in the case of a directory that does not make an entry in its parent dir. This can be tested by waiting for the inode sync after cd'ing from a shell into a test fs. Then you "mkdir xxx yyy zzz", wait a second, and hit the machine reset button. Reviewed by: nate (Tested lots of crashes :) Submitted by: Terry Lambert <terry@lambert.org>
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Submitted by: Philippe Charnier <charnier@lirmm.fr>, distilled by bdebde1995-04-021-1/+1
| | | | Fix a couple more bogus types that aren't reported by `gcc -Wall'.
* Submitted by: phk, added to by bdebde1995-04-021-4/+26
| | | | Fix all the warnings from `gcc -Wall'.
* Two fixes from the NetBSD group (Charles Hannum):dg1994-09-091-5/+12
| | | | | | | 1) dir.c: get byte order right in mkentry() 2) pass1.c: When doing -c2 conversion, do secsize reads for a symlink - not doing so was causing the conversion to fail because the device driver can't deal with short reads.
* BSD 4.4 Lite sbin Sourcesrgrimes1994-05-261-0/+681
Note: XNSrouted and routed NOT imported here, they shall be imported with usr.sbin.
OpenPOWER on IntegriCloud