aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-20 00:45:40 -0400
committerDave Chinner <david@fromorbit.com>2016-10-20 00:45:40 -0400
commitd099245297e28fc9f8493edd9d5a1f0967a72511 (patch)
treec871c85d824b3dccc91771f574db0128a11ef70d
parentfe23759eaf2f6540de20c1623f066aad967ff9c9 (diff)
xfs: unset MS_ACTIVE if mount fails
As part of the inode block map intent log item recovery process, we had to set the IRECOVERY flag to prevent an unlinked inode from being truncated during the first iput call. This required us to set MS_ACTIVE so that iput puts the inode on the lru instead of immediately evicting the inode. Unfortunately, if the mount fails later on, the inodes that have been loaded (root dir and realtime) actually need to be evicted since we're aborting the mount. If we don't clear MS_ACTIVE in the failure step, those inodes are not evicted and therefore leak. The leak was found by running xfs/130 and rmmoding xfs immediately after the test. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
-rw-r--r--fs/xfs/xfs_mount.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index fc7873942bea..b341f10cf481 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1009,6 +1009,7 @@ xfs_mountfs(
1009 out_quota: 1009 out_quota:
1010 xfs_qm_unmount_quotas(mp); 1010 xfs_qm_unmount_quotas(mp);
1011 out_rtunmount: 1011 out_rtunmount:
1012 mp->m_super->s_flags &= ~MS_ACTIVE;
1012 xfs_rtunmount_inodes(mp); 1013 xfs_rtunmount_inodes(mp);
1013 out_rele_rip: 1014 out_rele_rip:
1014 IRELE(rip); 1015 IRELE(rip);