freebsd-dev/sbin/fsck_ffs
Jeff Roberson 280e091a99 Implement fully asynchronous partial truncation with softupdates journaling
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
2011-06-10 22:48:35 +00:00
..
dir.c Eliminate linked list used to track inodes with an initial link 2004-10-08 20:44:47 +00:00
ea.c Mechanical whitespace cleanup. 2011-04-27 02:55:03 +00:00
fsck_ffs.8 Add an -E option to mirror newfs's. The idea is that if you have a system 2011-04-29 23:00:23 +00:00
fsck.h Add an -E option to mirror newfs's. The idea is that if you have a system 2011-04-29 23:00:23 +00:00
fsutil.c Add an -E option to mirror newfs's. The idea is that if you have a system 2011-04-29 23:00:23 +00:00
gjournal.c - Merge soft-updates journaling from projects/suj/head into head. This 2010-04-24 07:05:35 +00:00
inode.c Mechanical whitespace cleanup. 2011-04-27 02:55:03 +00:00
main.c Add an -E option to mirror newfs's. The idea is that if you have a system 2011-04-29 23:00:23 +00:00
Makefile - Merge soft-updates journaling from projects/suj/head into head. This 2010-04-24 07:05:35 +00:00
pass1.c Add some error messages suggested in PR bin/138043. The code to 2010-01-07 01:10:49 +00:00
pass1b.c The got_siginfo = 0 should have been got_sigalarm=0 to match the other 2004-10-10 06:37:56 +00:00
pass2.c Mechanical whitespace cleanup. 2011-04-27 02:55:03 +00:00
pass3.c Eliminate linked list used to track inodes with an initial link 2004-10-08 20:44:47 +00:00
pass4.c Add support to background fsck to delete zero-length directories. 2010-05-20 06:05:40 +00:00
pass5.c Add an -E option to mirror newfs's. The idea is that if you have a system 2011-04-29 23:00:23 +00:00
setup.c In checker, read journal by sectors. 2011-02-12 13:17:14 +00:00
suj.c Implement fully asynchronous partial truncation with softupdates journaling 2011-06-10 22:48:35 +00:00
utilities.c Mechanical whitespace cleanup. 2011-04-27 02:55:03 +00:00