summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/suj.c
Commit message (Collapse)AuthorAgeFilesLines
* Add the -R option to allow fsck_ffs to restart itself when too many criticalscottl2013-12-301-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert 248634 and 248643 (e.g., restoring 248625 and 248639).mckusick2013-03-231-2/+2
| | | | Build verified by: Glen Barber (gjb@)
* Revert svn r248625sbruno2013-03-231-2/+2
| | | | | | | | Clang errors around printf could be trivially fixed, but the breakage in sbin/fsdb were to significant for this type of change. Submitter of this changeset has been notified and hopefully this can be restored soon.
* Speed up fsck by caching the cylinder group maps in pass1 somckusick2013-03-221-2/+2
| | | | | | | | | | | | | | | | | | | | that they do not need to be read again in pass5. As this nearly doubles the memory requirement for fsck, the cache is thrown away if other memory needs in fsck would otherwise fail. Thus, the memory footprint of fsck remains unchanged in memory constrained environments. This work was inspired by a paper presented at Usenix's FAST '13: www.usenix.org/conference/fast13/ffsck-fast-file-system-checker Details of this implementation appears in the April 2013 of ;login: www.usenix.org/publications/login/april-2013-volume-38-number-2. A copy of the April 2013 ;login: paper can also be downloaded from: www.mckusick.com/publications/faster_fsck.pdf. Reviewed by: kib Tested by: Peter Holm MFC after: 4 weeks
* - blk_equals() is too strict. If the journal entry defines more fragsjeff2012-11-141-10/+8
| | | | | | | | | | than we're claiming it should still be considered an exact match. This would previously leak frags that had been extended. - If there is a sequence number problem in the journal print the sequence numbers we've seen so far for debugging. - Clean up the block mask related debuging printfs. Some are redundant. MFC after: 1 week
* Fix some nearby type and style errors.mdf2012-09-281-3/+2
| | | | Pointed out by: bde
* Fix sbin/ build with a 64-bit ino_t.mdf2012-09-271-1/+1
| | | | Original code by: Gleb Kurtsou
* Fix fsck_ffs build with a 64-bit ino_t.mdf2012-09-271-64/+71
| | | | Original code by: Gleb Kurtsou
* - Fix a typo in debug message.zont2012-09-131-1/+1
| | | | | Approved by: kib (mentor) MFC after: 3 days
* fsck_ffs shall accept the configured journal size, and not refuse tokib2012-08-021-1/+1
| | | | | | | | | | operate on it if journal size is greater then SUJ_MAX. The later constant is only to select maximal journal size when user did not specified size explicitely. Submitted by: Andrey Zonov <andrey@zonov.org> Reviewed by: mckusick MFC after: 1 week
* For incompleted block allocations or frees, the inode block count usagekib2012-06-121-0/+15
| | | | | | | | | | | | | | | must be recalculated. The blk_check pass of suj checker explicitely marks inodes which owned such blocks as needing block count adjustment. But ino_adjblks() is only called by cg_trunc pass, which is performed before blk_check. As result, the block use count for such inodes is left wrong. This causes full fsck run after journaled run to still find inconsistencies like 'INCORRECT BLOCK COUNT I=14557 (328 should be 0)' in phase 1. Fix this issue by running additional adj_blk pass after blk_check, which updates the field. Reviewed by: jeff, mckusick MFC after: 1 week
* Change the type of real_dev_bsize variable from long to u_int.kib2011-12-201-1/+1
| | | | | | | | | | The DIOCGSECTORSIZE takes u_int * as an argument, using long * causes failures on big-endian targets. Diagnosed by: Michiel Boland <boland37 xs4all nl> PR: sparc64/163460 Tested by: pho (x86), flo (sparc64) MFC after: 1 week
* - Handle the JOP_SYNC case as appropriate.jeff2011-06-301-0/+1
| | | | Reported by: pho
* Implement fully asynchronous partial truncation with softupdates journalingjeff2011-06-101-36/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to resolve errors which can cause corruption on recovery with the old synchronous mechanism. - Append partial truncation freework structures to indirdeps while truncation is proceeding. These prevent new block pointers from becoming valid until truncation completes and serialize truncations. - On completion of a partial truncate journal work waits for zeroed pointers to hit indirects. - softdep_journal_freeblocks() handles last frag allocation and last block zeroing. - vtruncbuf/ffs_page_remove moved into softdep_*_freeblocks() so it is only implemented in one place. - Block allocation failure handling moved up one level so it does not proceed with buf locks held. This permits us to do more extensive reclaims when filesystem space is exhausted. - softdep_sync_metadata() is broken into two parts, the first executes once at the start of ffs_syncvnode() and flushes truncations and inode dependencies. The second is called on each locked buf. This eliminates excessive looping and rollbacks. - Improve the mechanism in process_worklist_item() that handles acquiring vnode locks for handle_workitem_remove() so that it works more generally and does not loop excessively over the same worklist items on each call. - Don't corrupt directories by zeroing the tail in fsck. This is only done for regular files. - Push a fsync complete record for files that need it so the checker knows a truncation in the journal is no longer valid. Discussed with: mckusick, kib (ffs_pages_remove and ffs_truncate parts) Tested by: pho
* Mechanical whitespace cleanup.des2011-04-271-10/+10
| | | | MFC after: 3 weeks
* In checker, read journal by sectors.kib2011-02-121-11/+17
| | | | | | | | | | | Due to UFS insistence to pretend that device sector size is 512 bytes, sector size is obtained from ioctl(DIOCGSECTORSIZE) for real devices, and from the label otherwise. The file images without label have to be made with 512 sector size. In collaboration with: pho Reviewed by: jeff Tested by: bz, pho
* The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilitiesmckusick2011-01-241-2/+3
| | | | | | | | | | | | | | include sys/time.h instead of time.h. This include is incorrect as per the manpages for the APIs and the POSIX definitions. This commit replaces sys/time.h where necessary with time.h. The commit also includes some minor style(9) header fixup in newfs. This commit is part of a larger effort by Garrett Cooper started in //depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more POSIX compliant. Submitted by: Garrett Cooper yanegomi at gmail dot com
* - Permit zero length directories as a handled inconsistency. This allowsjeff2010-07-061-46/+115
| | | | | | | | | directory truncation to proceed before the link has been cleared. This is accomplished by detecting a directory with no . or .. links and clearing the named directory entry in the parent. - Add a new function ino_remref() which handles the details of removing a reference to an inode as a result of a lost directory. There were some minor errors in various subcases of this routine.
* Improve fsck robustness for SU+J cases:delphij2010-06-221-52/+107
| | | | | | | | | | - Use err/errx only when the case is really fatal. For other cases, fall back to full fsck instead of quiting fsck. - Plug a memory leak. - Avoid divide by zero when printing summary. - Output "FILE SYSTEM IS MARKED CLEAN" when a successful journal recovering is done. - When -f is specified, do full fsck instead of journal recovery.
* suj.c seems to contain two versions of the code.pjd2010-04-241-2065/+0
| | | | Remove the one that doesn't compile.
* - Merge soft-updates journaling from projects/suj/head into head. Thisjeff2010-04-241-0/+4699
brings in support for an optional intent log which eliminates the need for background fsck on unclean shutdown. Sponsored by: iXsystems, Yahoo!, and Juniper. With help from: McKusick and Peter Holm
OpenPOWER on IntegriCloud