From 2c56547272e43b483d560a61692f1e24926a82fb Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Mon, 4 Aug 2014 13:06:48 -0400 Subject: every iput() and namei() must be inside a transaction --- fs.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fs.c') diff --git a/fs.c b/fs.c index 9d6dfd1..7621d08 100644 --- a/fs.c +++ b/fs.c @@ -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) { -- cgit v1.2.3