From: NeilBrown Date: Thu, 3 Sep 2009 05:28:19 +0000 (+1000) Subject: Be sure to alway unlock new inodes. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=e9b4417603c811a5baefa840eb8e1c703919deb5;p=LaFS.git Be sure to alway unlock new inodes. All error paths must unlock the new inode. And make sure nlink is 0 so that it will not be cached. --- diff --git a/inode.c b/inode.c index 6877780..50dffc7 100644 --- a/inode.c +++ b/inode.c @@ -65,13 +65,14 @@ lafs_iget(struct super_block *sb, ino_t inum, int async) if (err) { if (err != -ENOENT) printk("lafs_import_inode failed %d\n", err); - unlock_new_inode(ino); goto err; } putdref(b, MKREF(iget)); unlock_new_inode(ino); return ino; err: + ino->i_nlink = 0; + unlock_new_inode(ino); putdref(b, MKREF(iget)); iput(ino); return ERR_PTR(err);