freebsd-dev/sbin/fsck_ffs
Kirk McKusick 460ed6106c Add support for managing UFS/FFS snapshots to fsck_ffs(8).
The kernel handles the managment of UFS/FFS snapshots. Since UFS/FFS
updates filesystem data (rather than always writing changes to new
locations like ZFS), the kernel must check every filesystem write
to see if the block being written is part of a snapshot. If it is
part of a snapshot, then the kernel must make a copy of the old
block value into a newly allocated block for the snapshot before
allowing the write to be done. Similarly, if a block is being freed,
the kernel must check to see if it is part of a snapshot and let
the snapshot claim the block rather than freeing it for future use.
When a snapshot is freed, its blocks need to be offered to older
snapshots and freed only if no older snapshots wish to claim them.

When snapshots were added to UFS/FFS they were integrated into soft
updates and just a small part of the management of snapshots needed
to be added to fsck_ffs(8) as soft updates minimized the set of
snapshot changes that might need correction. When journaling was
added to soft updates a much more complete knowledge of snapshots
needed to be added to fsck_ffs(8) for it to be able to properly
handle the filesystem changes that a journal rollback needs to do
(specifically the freeing and allocation of blocks). Since this
functionality was unavailable, the use of snapshots was disabled
when running with journaled soft updates.

This set of changes imports the kernel code for the management of
snapshots to fsck_ffs(8). With this code in place it will become
possible to enable snapshots when running with journalled soft
updates. The most immediate benefit will be the ability to use
snapshots to take consistent filesystem dumps on live filesystems.
Future work will be done to update fsck_ffs(8) to be able to use
snapshots to run in background on live filesystems running with
journaled soft updates.

Reviewed by:  kib
Tested by:    Peter Holm
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36491
2022-11-09 10:46:31 -08:00
..
dir.c Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
ea.c Clean up error output for extended attributes in fsck_ffs(8). 2022-11-07 14:32:42 -08:00
fsck_ffs.8 Correct the location of the first backup superblock in fsck_ffs.8. 2019-08-07 16:56:00 +00:00
fsck.h Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
fsutil.c Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
gjournal.c Rewrite the disk I/O management system in fsck_ffs(8). Other than 2021-01-07 15:03:15 -08:00
globs.c Move the ability to search for alternate UFS superblocks from fsck_ffs(8) 2022-08-13 12:43:40 -07:00
inode.c Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
main.c Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
Makefile pkgbase: Put ufs related tools and lib in their own package 2022-10-26 19:46:34 +02:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pass1.c Clarify error messages about bad inodes. 2022-09-06 16:17:11 -07:00
pass1b.c Flush and close getnextino cache when done using it in Pass 1b. 2022-09-03 14:15:50 -07:00
pass2.c Improve handling of missing '.' and '..' in UFS directories. 2022-08-17 14:19:59 -07:00
pass3.c Rewrite the disk I/O management system in fsck_ffs(8). Other than 2021-01-07 15:03:15 -08:00
pass4.c Rewrite the disk I/O management system in fsck_ffs(8). Other than 2021-01-07 15:03:15 -08:00
pass5.c Additional diagnostic output when running fsck_ffs with debugging flag (-d) 2022-10-30 15:00:20 -07:00
setup.c Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
suj.c Add support for managing UFS/FFS snapshots to fsck_ffs(8). 2022-11-09 10:46:31 -08:00
utilities.c Remove unused includes. 2019-12-22 05:44:29 +00:00