mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
6b9d4fbb7f
The function ffs_vgetf() is used to find or load UFS inodes into a vnode. It first looks up the inode and if found in the cache its vnode is returned. If it is not already in the cache, a new vnode is allocated and its associated inode read in from the disk. The read is done even for inodes that are being initially created. The contents for the inode on the disk are assumed to be empty. If the on-disk contents had been corrupted either due to a hardware glitch or an agent deliberately trying to exploit the system, the UFS code could panic from the unexpected partially-allocated inode. Rather then having fsck_ffs(8) verify that all unallocated inodes are properly empty, it is easier and quicker to add a flag to ffs_vgetf() to indicate that the request is for a newly allocated inode. When set, the disk read is skipped and the inode is set to its expected empty (zero'ed out) initial state. As a side benefit, an unneeded disk I/O is avoided. Reported by: Peter Holm Sponsored by: The FreeBSD Foundation |
||
---|---|---|
.. | ||
ffs_alloc.c | ||
ffs_balloc.c | ||
ffs_extern.h | ||
ffs_inode.c | ||
ffs_rawread.c | ||
ffs_snapshot.c | ||
ffs_softdep.c | ||
ffs_subr.c | ||
ffs_suspend.c | ||
ffs_tables.c | ||
ffs_vfsops.c | ||
ffs_vnops.c | ||
fs.h | ||
softdep.h |