every iput() and namei() must be inside a transaction

This commit is contained in:
Robert Morris 2014-08-04 13:06:48 -04:00
parent 020c8e2384
commit 2c56547272
6 changed files with 145 additions and 17 deletions

3
fs.c
View file

@ -314,6 +314,8 @@ iunlock(struct inode *ip)
// be recycled.
// If that was the last reference and the inode has no links
// to it, free the inode (and its content) on disk.
// All calls to iput() must be inside a transaction in
// case it has to free the inode.
void
iput(struct inode *ip)
{
@ -601,6 +603,7 @@ skipelem(char *path, char *name)
// Look up and return the inode for a path name.
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{