Skip to content
Snippets Groups Projects
Commit f12551b5 authored by rsc's avatar rsc
Browse files

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.
parent 0badeaa2
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment