diff options
author | rsc <rsc> | 2009-05-31 01:34:46 +0000 |
---|---|---|
committer | rsc <rsc> | 2009-05-31 01:34:46 +0000 |
commit | f12551b5996ae6121d33afc94002ce6f7c64dcfd (patch) | |
tree | 3ac705b14a43214af68ba44d80a95f037b127d65 /fs.c | |
parent | 0badeaa29fa6bd7e72e460f4c4c68d57fec8e388 (diff) | |
download | xv6-labs-f12551b5996ae6121d33afc94002ce6f7c64dcfd.tar.gz xv6-labs-f12551b5996ae6121d33afc94002ce6f7c64dcfd.tar.bz2 xv6-labs-f12551b5996ae6121d33afc94002ce6f7c64dcfd.zip |
inode reuse bug.
Suppose an inode has been used and freed.
It is left marked I_VALID (the bug).
Now ialloc comes along and reuses the
inode. It writes the new inode type to disk
and returns iget(dev, inum) to get the
cache entry. Iget sees that the inode is valid
and doesn't bother refreshing from disk.
Now when the caller iupdates, it will write
out a zero type and the file or directory has
disappeared.
Diffstat (limited to 'fs.c')
-rw-r--r-- | fs.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -227,7 +227,7 @@ iunlock(struct inode *ip) panic("iunlock"); acquire(&icache.lock); - ip->flags &= ~I_BUSY; + ip->flags = 0; wakeup(ip); release(&icache.lock); } |