vfs: fix inode_init_always calling convention
commitb1abc2814585a3a13ce725ba62f62e9dc531010c
authorChristoph Hellwig <hch@infradead.org>
Wed, 19 Aug 2009 18:42:59 +0000 (19 14:42 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 9 Sep 2009 03:33:54 +0000 (8 20:33 -0700)
tree599e9b250fb50b61d935f3a2da62a0ac2ff41158
parent3723aab300dfc33a8e90cfd53cd122c097bfa437
vfs: fix inode_init_always calling convention

backport of upstream commit 54e346215e4fe2ca8c94c54e546cc61902060510

Currently inode_init_always calls into ->destroy_inode if the additional
initialization fails.  That's not only counter-intuitive because
inode_init_always did not allocate the inode structure, but in case of
XFS it's actively harmful as ->destroy_inode might delete the inode from
a radix-tree that has never been added.  This in turn might end up
deleting the inode for the same inum that has been instanciated by
another process and cause lots of cause subtile problems.

Also in the case of re-initializing a reclaimable inode in XFS it would
free an inode we still want to keep alive.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/inode.c
fs/xfs/xfs_iget.c
include/linux/fs.h