aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/pass1.c
Commit message (Collapse)AuthorAgeFilesLines
* Add some error messages suggested in PR bin/138043. The code toKirk McKusick2010-01-071-2/+8
| | | | | | | | | | correct the problem was added in r176575 by delphij on 2008-02-25. PR: 138043 Reported by: Heikki Suonsivu Notes: svn path=/head/; revision=201708
* Update the actions previously attempted by the -D option to make themKirk McKusick2009-02-041-21/+60
| | | | | | | | | | | | | | | | | | | | | robust. With these changes fsck is now able to detect and reliably rebuild corrupted cylinder group maps. The -D option is no longer necessary as it has been replaced by a prompt asking whether the corrupted cylinder group should be rebuilt and doing so when requested. These actions are only offered and taken when running fsck in manual mode. Corrupted cylinder groups found during preen mode cause the fsck to fail. Add the -r option to free up excess unused inodes. Decreasing the number of preallocated inodes reduces the running time of future runs of fsck and frees up space that can allocated to files. The -r option is ignored when running in preen mode. Reviewed by: Xin LI <delphij@> Sponsored by: Rsync.net Notes: svn path=/head/; revision=188110
* In pass1(), cap inosused to fs_ipg rather than allowing arbitraryXin LI2008-02-261-2/+4
| | | | | | | | | number read from cylinder group. Chances that we read a smarshed cylinder group, and we can not 100% trust information it has supplied. fsck_ffs(8) will crash otherwise for some cases. Notes: svn path=/head/; revision=176575
* Eliminate linked list used to track inodes with an initial linkDon Lewis2004-10-081-16/+5
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=136281
* Create DIP_SET() and IBLK_SET() macros to fix lvalue warnings.Scott Long2004-09-011-3/+3
| | | | | | | Inspired by: kan Notes: svn path=/head/; revision=134589
* Remove advertising clause from University of California Regent's license,Mark Murray2004-04-091-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core, imp Notes: svn path=/head/; revision=128073
* In the case of a background fsck, periodically update the process titleScott Long2004-02-281-0/+5
| | | | | | | with a progress update. Notes: svn path=/head/; revision=126345
* Avoid dereferencing null pointers in fsck_ffs. (pfatal may return,Colin Percival2004-01-261-2/+2
| | | | | | | | | | so it isn't a safe way of handling [mc]alloc failures.) PR: misc/61800 Approved by: rwatson (mentor) Notes: svn path=/head/; revision=125036
* Use __FBSDID() to quiet GCC 3.3 warnings.David E. O'Brien2003-05-031-4/+4
| | | | Notes: svn path=/head/; revision=114589
* Use the standardized CHAR_BIT constant instead of NBBY in userland.Mike Barcroft2002-09-251-3/+4
| | | | Notes: svn path=/head/; revision=103949
* Add support to fsck_ffs to account for storage for extendedKirk McKusick2002-09-241-1/+19
| | | | | | | | | attributes. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=103885
* Add a source file where EXTATTR checks will happen and hook it in evenPoul-Henning Kamp2002-09-161-0/+2
| | | | | | | | | if it doesn't do anything yet. Sponsored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=103398
* s/filesystem/file system/g as discussed on -developersTom Rhodes2002-08-211-1/+1
| | | | Notes: svn path=/head/; revision=102231
* Fix a bunch of format string warnings which brokeMaxime Henrion2002-07-311-13/+15
| | | | | | | | | the sparc64 build. Tested on: sparc64, i386 Notes: svn path=/head/; revision=101037
* Warning cleanup.Poul-Henning Kamp2002-07-301-3/+2
| | | | | | | Format changes by peter Notes: svn path=/head/; revision=100935
* Remove the kernel file-size limit for UFS2, so that only the limitIan Dowse2002-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 Notes: svn path=/head/; revision=98888
* Fix an integer overflow that causes fsck_ffs to crash when itIan Dowse2002-06-261-1/+1
| | | | | | | | | encounters very large file sizes in the filesystem. Reviewed by: mckusick Notes: svn path=/head/; revision=98879
* This commit adds basic support for the UFS2 filesystem. The UFS2Kirk McKusick2002-06-211-53/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=98542
* more file system > filesystemTom Rhodes2002-05-161-1/+1
| | | | Notes: svn path=/head/; revision=96707
* UFS2 preparation commit:Poul-Henning Kamp2002-05-121-27/+0
| | | | | | | | | | Remove support for converting old FFS formats to newer. Submitted by: mckusick Sponspored by: DARPA & NAI Labs. Notes: svn path=/head/; revision=96483
* o __P removedWarner Losh2002-03-201-7/+4
| | | | | | | | | | 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-201-4/+4
| | | | | | | | | 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
* Fix a large number of -Wall, -Wformat and -W compiler warnings.Ian Dowse2001-11-171-6/+8
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=86514
* Additions to run checks on live filesystems. This change will notKirk McKusick2001-03-211-4/+16
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=74556
* Don't allow special devices of type NODEV (NOUDEV as seen from kernel).Tor Egge2001-02-151-0/+5
| | | | | | | | | They can't be created via mknod and the kernel crashes if it encounters such an inode. Approved by: mckusick Notes: svn path=/head/; revision=72525
* Fsck_ffs did not properly range-check the inode 'di_size'Ian Dowse2001-01-311-3/+6
| | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=71884
* Add a simple SIGINFO handler to fsck_ffs. Shortly after receipt ofIan Dowse2000-12-151-0/+6
| | | | | | | | | | | 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 Notes: svn path=/head/; revision=70050
* added growfs(8) including ffsinfo(8) to the freebsd base systemThomas-Henning von Kamptz2000-12-091-1/+5
| | | | | | | Reviewed by: grog Notes: svn path=/head/; revision=69800
* 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-061-1/+20
| | | | | | | | | | 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
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50476
* Cosmetic and documentation changes brought from earlier FreeBSD versions.Julian Elischer1998-12-031-1/+4
| | | | | | | (e.g. RCS Id:) Notes: svn path=/head/; revision=41477
* Reviewed by: Don Lewis <Don.Lewis@tsc.tdk.com>Julian Elischer1998-12-031-21/+89
| | | | | | | | | | | | | | | 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
* 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-281-8/+7
| | | | Notes: svn path=/head/; revision=37236
* Correct use of .Nm. Add rcsid. Remove unused #includes. Use err(3).Philippe Charnier1998-06-151-1/+4
| | | | Notes: svn path=/head/; revision=37000
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)Julian Elischer1998-03-081-4/+12
| | | | | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree Notes: svn path=/head/; revision=34266
* Restore check for ridiculous directory sizes.Peter Wemm1997-03-181-2/+2
| | | | Notes: svn path=/head/; revision=23999
* Finished (?) merging with Lite2: cleaned up #include mess.Bruce Evans1997-03-121-3/+2
| | | | | | | Fixed style bugs in FreeBSD changes. Notes: svn path=/head/; revision=23798
* Merge from Lite2. Note that Lite2 has it's own filesystem clean checkPeter Wemm1997-03-111-20/+24
| | | | | | | | skipping code that overrides ours sooner. One should be eliminated, but for now it works. Notes: svn path=/head/; revision=23675
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-1/+1
| | | | Notes: svn path=/head/; revision=8871
* Submitted by: phk, added to by bdeBruce Evans1995-04-021-4/+8
| | | | | | | Fix all the warnings from `gcc -Wall'. Notes: svn path=/head/; revision=7585
* Woops, last patch was by Wolfgang Solfrank.David Greenman1994-09-091-1/+1
| | | | Notes: svn path=/head/; revision=2605
* Two fixes from the NetBSD group (Charles Hannum):David Greenman1994-09-091-2/+3
| | | | | | | | | | 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. Notes: svn path=/head/; revision=2603
* Fixed so that it can grok old style "fastlinks".David Greenman1994-08-021-1/+1
| | | | Notes: svn path=/head/; revision=1820
* BSD 4.4 Lite sbin SourcesRodney W. Grimes1994-05-261-0/+314
Note: XNSrouted and routed NOT imported here, they shall be imported with usr.sbin. Notes: svn path=/head/; revision=1558