summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs
Commit message (Collapse)AuthorAgeFilesLines
* Mention the default location of alternative super block on adelphij2005-09-201-2/+2
| | | | | | | | UFS2 file system, in fsck_ffs(8). Submitted by: KOMATSU Shinichiro <koma2 at lovepeers ! org> PR: docs/86362 MFC After: 3 days
* Make background fsck based summary adjustments actually work bydelphij2005-03-073-5/+24
| | | | | | | | | | | | | | | | | | | | | | | initializing the sysctl mibs data before actually using them. The original patchset (which is the actual version that is running on my testboxes) have checked whether all of these sysctls and refuses to do background fsck if we don't have them. Kirk has pointed out that refusing running fsck on old kernels is pointless, as old kernels will recompute the summary at mount time, so I have removed these checks. Unfortunatelly, as the checks will initialize the mib values of those sysctl's, and which are vital for the runtime summary adjustment to work, we can not simply remove the check, which will lead to problem when running background fsck over a dirty volume. Add these checks in a different way: give a warning rather than refusing to work, and complain if the functionality is not available when adjustments are necessary. Noticed by: A power failure at my lab Pointy hat: me MFC After: 3 days
* The recomputation of file system summary at mount time can be adelphij2005-02-202-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | very slow process, especially for large file systems that is just recovered from a crash. Since the summary is already re-sync'ed every 30 second, we will not lag behind too much after a crash. With this consideration in mind, it is more reasonable to transfer the responsibility to background fsck, to reduce the delay after a crash. Add a new sysctl variable, vfs.ffs.compute_summary_at_mount, to control this behavior. When set to nonzero, we will get the "old" behavior, that the summary is computed immediately at mount time. Add five new sysctl variables to adjust ndir, nbfree, nifree, nffree and numclusters respectively. Teach fsck_ffs about these API, however, intentionally not to check the existence, since kernels without these sysctls must have recomputed the summary and hence no adjustments are necessary. This change has eliminated the usual tens of minutes of delay of mounting large dirty volumes. Reviewed by: mckusick MFC After: 1 week
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-102-2/+2
|
* Added the EXIT STATUS section where appropriate.ru2005-01-171-2/+2
|
* Do not pass random bits as mount arguments.phk2004-12-121-0/+1
|
* Explicitly break out NETA license from Berkeley license to clearlyrwatson2004-10-201-0/+21
| | | | | | | indicate license grant, as well as to indicate that NETA is asserting only two clauses, not four clauses. Requested by: imp
* The got_siginfo = 0 should have been got_sigalarm=0 to match the otherimp2004-10-101-1/+1
| | | | | | passes. Submitted by: Dworkin Muller
* Eliminate linked list used to track inodes with an initial linktruckman2004-10-0810-60/+43
| | | | | | | | | 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
* Move back to WARNS=2scottl2004-09-011-1/+1
|
* Create DIP_SET() and IBLK_SET() macros to fix lvalue warnings.scottl2004-09-015-40/+59
| | | | Inspired by: kan
* Generalize the UFS bad magic value used to determine when a filesystemjhb2004-08-191-2/+2
| | | | | | | | has only been partly initialized via newfs(8) so that it applies to both UFS1 and UFS2. Submitted by: "Xin LI" delphij at frontfree dot net MFC: maybe?
* Downgrade WARNS level until GCC 3.4.2 warning have been fixed.kan2004-07-281-1/+1
|
* Mechanically kill hard sentence breaks.ru2004-07-021-2/+4
|
* Improve the delay algorithm used in bgfsck. From the author:scottl2004-05-181-4/+6
| | | | | | | | | | | | | | | shuffles the timing and sleep calls in bgfsck from: sleep timer_on io timer_off io io io io io io io to sleep io io io io io io io timer_on io timer_off The original method basically guaranteed that the timed I/O included a disk seek every time, which made bgfsck sleep for much longer than necessary. Submitted by: Dan Nelson Reviewed by: kirk
* Remove advertising clause from University of California Regent's license,markm2004-04-0919-76/+0
| | | | | | per letter dated July 22, 1999. Approved by: core, imp
* Remove a stray \n from a setproctitle.dwmalone2004-03-301-1/+1
| | | | Submitted by: Niki Denev <nike_d@cytexbg.com>
* In the case of a background fsck, periodically update the process titlescottl2004-02-289-0/+47
| | | | with a progress update.
* style.Makefile(5):johan2004-02-231-1/+1
| | | | Use WARNS?= instead of WARNS=.
* Avoid dereferencing null pointers in fsck_ffs. (pfatal may return,cperciva2004-01-262-2/+7
| | | | | | | so it isn't a safe way of handling [mc]alloc failures.) PR: misc/61800 Approved by: rwatson (mentor)
* Add manual page links from fsck_ufs.8 and fsck_4.2bsd.8 to fsck_ffs.8,simon2004-01-101-0/+1
| | | | | | since there are already the same links for the program binary. Suggested by: mat
* Catch and report on filesystems that were interrupted during newfs,wes2003-11-161-0/+12
| | | | | sporting the new 'BAD' magic number. Exit with a unique error code (11) so callers who care about this can respond appropriately.
* 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
* Create a .snap directory mode 770 group operator in the root of eachmckusick2003-10-081-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | filesystem that is checked in background. Create the snapshot in this directory rather than in the root. There are two benefits: 1) For terabyte-sized filesystems, the snapshot may require many minutes to build. Although the filesystem will not be suspended during most of the snapshot build, the snapshot file itself is locked during the entire snapshot build period. Thus, if it is accessed during the period that it is being built, the process trying to access it will block holding its containing directory locked. If the snapshot is in the root, the root will lock and the system will come to a halt until the snapshot finishes. By putting the snapshot in a subdirectory, it is out of the likely path of any process traversing through the root and hence much less likely to cause a lock race to the root. 2) The dump program is usually run by a non-root user running with operator group privilege. Such a user is typically not permitted to create files in the root of a filesystem. By having a directory in group operator with group write access available, such a user will be able to create a snapshot there. Having the dump program create its snapshot in a subdirectory below the root will benefit from point (1) as well. Sponsored by: DARPA & NAI Labs.
* Spell "file system" correctly.ru2003-08-013-3/+3
|
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-0313-47/+43
|
* Correct lines incorrectly added to the copyright message. Add missing period.mckusick2003-02-141-4/+1
| | | | | Submitted by: Bruce Evans <bde@zeta.org.au> Sponsored by: DARPA & NAI Labs.
* MFp4: Make ifs consistant with rest of file.imp2002-12-131-3/+3
|
* Uniformly refer to a file system as "file system".ru2002-12-121-1/+1
| | | | Approved by: re
* Slow down the operation of background fsck so as to leave some diskiedowse2002-12-071-1/+46
| | | | | | | | | | | | | | | bandwidth for other processes. Since the sleeping is done from userland, this avoids the locking issues that affected the kernel version. The algorithm used here is to measure a moving average of the times taken by a sample of read operations and then delay 1 in 8 reads by 16 times the measured average. This should correspond to a factor of 3 slowdown, but in practice the factor is larger (3.5 to 4) due to hz rounding effects. Reviewed by: mckusick Approved by: re
* Verify that alternate superblocks have a correct magic number beforemckusick2002-12-021-9/+10
| | | | | | | | | trying to use them. Set a minimum value for numdirs when using an alternate superblock to avoid spurious numdirs == 0 error. Calculate new fields when using an alternate superblock from a UFS1 filesystem to avoid segment faulting. Sponsored by: DARPA & NAI Labs.
* Create a new 32-bit fs_flags word in the superblock. Add code to movemckusick2002-11-272-4/+3
| | | | | | | | | | | | | | | | | the old 8-bit fs_old_flags to the new location the first time that the filesystem is mounted by a new kernel. One of the unused flags in fs_old_flags is used to indicate that the flags have been moved. Leave the fs_old_flags word intact so that it will work properly if used on an old kernel. Change the fs_sblockloc superblock location field to be in units of bytes instead of in units of filesystem fragments. The old units did not work properly when the fragment size exceeeded the superblock size (8192). Update old fs_sblockloc values at the same time that the flags are moved. Suggested by: BOUWSMA Barry <freebsd-misuser@netscum.dyndns.dk> Sponsored by: DARPA & NAI Labs.
* Fsck needs to check each CG's rotor values to ensure thay are not -ve.julian2002-11-241-3/+3
| | | | | | | | | | | It seems a common corruption to have them -ve (I've seen it several times) and if fsck doesn't fix it, it leads to a kernel pagefault. Reviewd by: kirk Submitted by: Eric Jacobs <eaja@erols.com> and me independently. MFC in: 2 days PR: bin/40967 Approved by: re
* Clear the pending counts in the superblock after a successful runmckusick2002-10-191-1/+4
| | | | | | | of fsck so that the kernel does not complain about them being non-zero when the filesystem is mounted. Sponsored by: DARPA & NAI Labs.
* When verifying a superblock, the lower bound on block size is MINBSIZEmckusick2002-10-101-1/+1
| | | | | | | (4096), not SBLOCKSIZE (8192). Submitted by: Tor.Egge@cvsup.no.freebsd.org Sponsored by: DARPA & NAI Labs.
* Use the standardized CHAR_BIT constant instead of NBBY in userland.mike2002-09-253-10/+13
|
* Add support to fsck_ffs to account for storage for extendedmckusick2002-09-241-1/+19
| | | | | | attributes. Sponsored by: DARPA & NAI Labs.
* Add a source file where EXTATTR checks will happen and hook it in evenphk2002-09-164-2/+93
| | | | | | if it doesn't do anything yet. Sponsored by: DARPA & NAI Labs.
* Fix some 'SYNOPSIS' and 'usage' messages.trhodes2002-08-271-1/+1
|
* Replace various spelling with FALLTHROUGH which is lint()ablecharnier2002-08-252-11/+13
|
* s/filesystem/file system/g as discussed on -developerstrhodes2002-08-2112-241/+241
|
* Fix more breakage due to FSTYPENAMES/DKTYPENAMES split.bmilekic2002-08-161-0/+1
| | | | Also submitted by: David Wolfskill <david@catwhisker.org>
* Don't '#define DKTYPENAMES', we don't use the variable it exposes fromalfred2002-08-161-1/+0
| | | | the header file.
* preen.c was a stragler after the fsck/fsck_ffs divorce.phk2002-08-091-282/+0
| | | | | | | | | | | | | | | fsck_ffs did not need it, but quotacheck did include it from fsck_ffs. A repocopy has now moved the fsck_ffs/preen.c file to quotacheck/preen.c quotacheck and fsck should probably use the same checkfstab() function and it should possibly live in libufs. Trouble is: they have diverged in the meantime. At least now fsck_ffs is not in the equation anymore. Sponsored by: DARPA & NAI Labs.
* Fix a bunch of format string warnings which brokemux2002-07-316-35/+43
| | | | | | the sparc64 build. Tested on: sparc64, i386
* Remove some additional paranoia which Kirk forgot to remove from hisphk2002-07-302-4/+2
| | | | | | | | | | | | | UFS2 commit. These bits in essence made any instance of "softupdates expected corrution", (ie blocks marked allocated but not referenced by an inode etc) result in a exit value for fsck_ffs of 2. 2 is part of the magic and appearantly undocumented protocol between fsck_FOO and fsck and means "dump into single user mode ASAP. Sponsored by: DARPA & NAI Labs.
* Warning cleanup.phk2002-07-3010-71/+71
| | | | Format changes by peter
* Remove the kernel file-size limit for UFS2, so that only the limitiedowse2002-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
* Fix an integer overflow that causes fsck_ffs to crash when itiedowse2002-06-261-1/+1
| | | | | | encounters very large file sizes in the filesystem. Reviewed by: mckusick
* This commit adds basic support for the UFS2 filesystem. The UFS2mckusick2002-06-2111-374/+477
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud