提交 77508ec8 编写于 作者: C Christoph Hellwig 提交者: Lachlan McIlroy

[XFS] move root inode IRELE into xfs_unmountfs

The root inode is allocated in xfs_mountfs so it should be release in
xfs_unmountfs. For the unmount case that means we do it after the the
xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE) in the forced shutdown case and the
dmapi unmount event. Note that both reference the rip variable which might
be freed by that time in case inode flushing has kicked in, so strictly
speaking this might count as a bug fix

SGI-PV: 981498

SGI-Modid: xfs-linux-melb:xfs-kern:31830a
Signed-off-by: NChristoph Hellwig <hch@infradead.org>
Signed-off-by: NLachlan McIlroy <lachlan@sgi.com>
上级 3a76c1ea
...@@ -1131,8 +1131,6 @@ xfs_fs_put_super( ...@@ -1131,8 +1131,6 @@ xfs_fs_put_super(
error = xfs_unmount_flush(mp, 0); error = xfs_unmount_flush(mp, 0);
WARN_ON(error); WARN_ON(error);
IRELE(rip);
/* /*
* If we're forcing a shutdown, typically because of a media error, * If we're forcing a shutdown, typically because of a media error,
* we want to make sure we invalidate dirty pages that belong to * we want to make sure we invalidate dirty pages that belong to
...@@ -1804,8 +1802,6 @@ xfs_fs_fill_super( ...@@ -1804,8 +1802,6 @@ xfs_fs_fill_super(
error = xfs_unmount_flush(mp, 0); error = xfs_unmount_flush(mp, 0);
WARN_ON(error); WARN_ON(error);
IRELE(mp->m_rootip);
xfs_unmountfs(mp); xfs_unmountfs(mp);
goto out_free_fsname; goto out_free_fsname;
} }
......
...@@ -1250,6 +1250,8 @@ xfs_unmountfs(xfs_mount_t *mp) ...@@ -1250,6 +1250,8 @@ xfs_unmountfs(xfs_mount_t *mp)
__uint64_t resblks; __uint64_t resblks;
int error = 0; int error = 0;
IRELE(mp->m_rootip);
/* /*
* We can potentially deadlock here if we have an inode cluster * We can potentially deadlock here if we have an inode cluster
* that has been freed has it's buffer still pinned in memory because * that has been freed has it's buffer still pinned in memory because
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册