summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-08-07 14:38:29 -0300
committerChristoph Hellwig <hch@brick.lst.de>2009-08-07 14:38:29 -0300
commit2e00c97e2c1d2ffc9e26252ca26b237678b0b772 (patch)
treee2c65f473e079c4b6027f7f8b7224febe7483884
parent54e346215e4fe2ca8c94c54e546cc61902060510 (diff)
downloadop-kernel-dev-2e00c97e2c1d2ffc9e26252ca26b237678b0b772.zip
op-kernel-dev-2e00c97e2c1d2ffc9e26252ca26b237678b0b772.tar.gz
vfs: add __destroy_inode
When we want to tear down an inode that lost the add to the cache race in XFS we must not call into ->destroy_inode because that would delete the inode that won the race from the inode cache radix tree. This patch provides the __destroy_inode helper needed to fix this, the actual fix will be in th next patch. As XFS was the only reason destroy_inode was exported we shift the export to the new __destroy_inode. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--fs/inode.c10
-rw-r--r--include/linux/fs.h1
2 files changed, 8 insertions, 3 deletions
diff --git a/fs/inode.c b/fs/inode.c
index af2c052..ae7b67e 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -229,7 +229,7 @@ static struct inode *alloc_inode(struct super_block *sb)
return inode;
}
-void destroy_inode(struct inode *inode)
+void __destroy_inode(struct inode *inode)
{
BUG_ON(inode_has_buffers(inode));
ima_inode_free(inode);
@@ -241,13 +241,17 @@ void destroy_inode(struct inode *inode)
if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED)
posix_acl_release(inode->i_default_acl);
#endif
+}
+EXPORT_SYMBOL(__destroy_inode);
+
+void destroy_inode(struct inode *inode)
+{
+ __destroy_inode(inode);
if (inode->i_sb->s_op->destroy_inode)
inode->i_sb->s_op->destroy_inode(inode);
else
kmem_cache_free(inode_cachep, (inode));
}
-EXPORT_SYMBOL(destroy_inode);
-
/*
* These are initializations that only need to be done
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0c3b5e5..67888a9 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2164,6 +2164,7 @@ extern void __iget(struct inode * inode);
extern void iget_failed(struct inode *);
extern void clear_inode(struct inode *);
extern void destroy_inode(struct inode *);
+extern void __destroy_inode(struct inode *);
extern struct inode *new_inode(struct super_block *);
extern int should_remove_suid(struct dentry *);
extern int file_remove_suid(struct file *);
OpenPOWER on IntegriCloud