freebsd-dev/sbin/fsck_ffs
Kirk McKusick 52f9710412 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems.
If a directory entry has an illegal inode number (less than zero
or greater than the last inode in the filesystem) the entry is removed.
If a directory '.' or '..' entry had an illegal inode number they
were being removed. Since fsck_ffs knows what the correct value is
for these two entries fix them rather deleting them.

Add much more extensive cylinder group checks and use them to be
more careful about rebuilding a cylinder group.

Check for out-of-range block numbers before trying to free them.

When a directory is deleted also remove its cache entry created
in pass1 so that later passes do not try to operate on a deleted
directory.

Check for ctime(3) returning NULL before trying to use its return.

When freeing a  directory inode, do not try to interpret it as a
directory.

Reserve space in the inostatlist to have room to allocate a
lost+found directory.

If an invalid block number is found past the end of an inode simply
remove it rather than clearing and removing the inode.

Modernize the inoinfo structure to use queue(3) LIST rather than a
handrolled linked list implementation.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668
2023-03-07 15:14:47 -08:00
..
dir.c Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -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 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -08:00
fsutil.c Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -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 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -08:00
main.c sys/param.h: Add _WANT_P_OSREL 2023-02-15 02:43:18 +02: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 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -08: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 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -08: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 Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -08:00
suj.c Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems. 2023-03-07 15:14:47 -08:00
utilities.c Remove unused includes. 2019-12-22 05:44:29 +00:00