]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: fix inode_init_always calling convention
authorChristoph Hellwig <hch@lst.de>
Fri, 7 Aug 2009 17:38:25 +0000 (14:38 -0300)
committerChristoph Hellwig <hch@brick.lst.de>
Fri, 7 Aug 2009 17:38:25 +0000 (14:38 -0300)
commitdda4d838e583523f89032369cd8cf988cdb19fd6
tree9b4ed9b0ab78117ba1a41db7073708031622cf10
parent869c775a96af162e5b7b7f1f562f4fe164a06f2c
vfs: fix inode_init_always calling convention

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>
fs/inode.c
fs/xfs/xfs_iget.c
include/linux/fs.h