3a6eed1f58
> ---------------------------- > revision 1.54 > date: 2001/08/26 01:25:12; author: iedowse; state: Exp; lines: +30 -12 > When compacting directories, ufs_direnter() always trusted DIRSIZ() > to supply the number of bytes to be bcopy()'d to move an entry. If > d_ino == 0 however, DIRSIZ() is not guaranteed to return a sensible > length, so ufs_direnter could end up corrupting a directory during > compaction. In practice I believe this can only happen after fsck_ffs > has fixed a previously-corrupted directory. > > We now deal with any mid-block unused entries specially to avoid > using DIRSIZ() or bcopy() on such entries. We also ensure that the > variables 'dsize' and 'spacefree' contain meaningful values at all > times. Add a few comments to describe better this intricate piece > of code. > > The special handling of mid-block unused entries makes the dirhash- > specific bugfix in the previous revision (1.53) now uncecessary, > so this change removes it. > > Reviewed by: mckusick > ---------------------------- > revision 1.53 > date: 2001/08/22 01:35:17; author: iedowse; state: Exp; lines: +2 -2 > When compressing directory blocks, the dirhash code didn't check > that the directory entry was in use before attempting to find it > in the hash structures to change its offset. Normally, unused > entries do not need to be moved, but fsck can leave behind some > unused entries that do. A dirhash sanity panic resulted when the > entry to be moved was not found. Add a check that stops entries > with d_ino == 0 from being passed to ufsdirhash_move(). |
||
---|---|---|
bin | ||
common/lib/libc | ||
crypto | ||
dist | ||
distrib | ||
doc | ||
etc | ||
games | ||
gnu | ||
include | ||
lib | ||
libexec | ||
regress | ||
rescue | ||
sbin | ||
share | ||
sys | ||
tools | ||
usr.bin | ||
usr.sbin | ||
x11 | ||
build.sh | ||
BUILDING | ||
Makefile | ||
Makefile.inc | ||
UPDATING |