diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-10-03 18:11:29 +0200 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2016-10-04 20:05:44 +0200 |
commit | 17c12bcd3030e4b3247d0c961ce598c731a9dcf9 (patch) | |
tree | 6f3cf25e6946232fa12a73df795f43a873f68193 /fs/xfs/xfs_mount.c | |
parent | xfs: implement deferred bmbt map/unmap operations (diff) | |
download | linux-17c12bcd3030e4b3247d0c961ce598c731a9dcf9.tar.xz linux-17c12bcd3030e4b3247d0c961ce598c731a9dcf9.zip |
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>
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r-- | fs/xfs/xfs_mount.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 3f64615f58db..a78a1164bab3 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -925,6 +925,15 @@ xfs_mountfs( } /* + * During the second phase of log recovery, we need iget and + * iput to behave like they do for an active filesystem. + * xfs_fs_drop_inode needs to be able to prevent the deletion + * of inodes before we're done replaying log items on those + * inodes. + */ + mp->m_super->s_flags |= MS_ACTIVE; + + /* * Finish recovering the file system. This part needed to be delayed * until after the root and real-time bitmap inodes were consistently * read in. |