diff mbox

xfs: unset MS_ACTIVE if mount fails

Message ID 20161018011051.GB20337@birch.djwong.org
State Accepted
Headers show

Commit Message

Darrick J. Wong Oct. 18, 2016, 1:10 a.m. UTC
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>
 fs/xfs/xfs_mount.c |    1 +
 1 file changed, 1 insertion(+)

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox


diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index fc78739..b341f10 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1009,6 +1009,7 @@  xfs_mountfs(
+	mp->m_super->s_flags &= ~MS_ACTIVE;