]> git.baikalelectronics.ru Git - kernel.git/commit
xfs: when replaying bmap operations, don't let unlinked inodes get reaped
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 3 Oct 2016 16:11:29 +0000 (09:11 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 4 Oct 2016 18:05:44 +0000 (11:05 -0700)
commitf5af6e59ded7780902db17d10c2ca5f6c4a513d8
tree6f3cf25e6946232fa12a73df795f43a873f68193
parent3c51f5f16475d69f7f86c0c38aebaf11aba6c198
xfs: when replaying bmap operations, don't let unlinked inodes get reaped

Log recovery will iget an inode to replay BUI items and iput the inode
when it's done.  Unfortunately, if the inode was unlinked, the iput
will see that i_nlink == 0 and decide to truncate & free the inode,
which prevents us from replaying subsequent BUIs.  We can't skip the
BUIs because we have to replay all the redo items to ensure that
atomic operations complete.

Since unlinked inode recovery will reap the inode anyway, we can
safely introduce a new inode flag to indicate that an inode is in this
'unlinked recovery' state and should not be auto-reaped in the
drop_inode path.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/xfs_bmap_item.c
fs/xfs/xfs_inode.c
fs/xfs/xfs_inode.h
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_mount.c
fs/xfs/xfs_super.c