freebsd-dev/sbin/fsck_ffs
Kirk McKusick f4fc389524 Properly handle the replacement of a partially allocated root directory.
If the root directory exists but has a bad block number Pass1 will
accept it and setup an inoinfo structure for it. When Pass2 runs
and cannot read the root inode's content because of a bad (or
duplicate) block number, it removes the bad root inode and replaces
it. As part of creating the replacement root inode, it creates an
inoinfo entry for it. But Pass2 did delete the inoinfo entry that
Pass1 had set up for the root inode so ended up with two inoinfo
structures for it. The final step of Pass2 checks that all the ".."
entries are correct adding them if they are missing which resulted
in a second ".." entry being added to the root directory which
definitely did not go over well in the kernel name cache!

Reported by:  Peter Holm
Sponsored by: The FreeBSD Foundation
2022-09-03 14:48:34 -07:00
..
dir.c Properly handle the replacement of a partially allocated root directory. 2022-09-03 14:48:34 -07:00
ea.c [skip ci] correct a few SPDX license tags 2021-07-07 13:52:20 -06: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 Properly handle the replacement of a partially allocated root directory. 2022-09-03 14:48:34 -07:00
fsutil.c Correct calculation of inode location in getnextino cache. 2022-08-28 23:09:29 -07: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 Properly handle the replacement of a partially allocated root directory. 2022-09-03 14:48:34 -07:00
main.c Move the ability to search for alternate UFS superblocks from fsck_ffs(8) 2022-08-13 12:43:40 -07:00
Makefile
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00
pass1.c Ensure that files with no allocated blocks are trimmed to zero length. 2021-05-11 14:52:26 -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 Use proper type (ino_t) for inode numbers to avoid improper sign extention 2020-10-25 21:04:07 +00:00
setup.c When reading backup UFS superblocks, report reason if they cannot be used. 2022-08-17 13:54:07 -07:00
suj.c Remove #define _KERNEL hacks from libprocstat 2021-02-21 11:38:21 +02:00
utilities.c Remove unused includes. 2019-12-22 05:44:29 +00:00