xfs: don't leak quotacheck dquots when cow recovery
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 10 Aug 2017 21:20:29 +0000 (14:20 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Thu, 17 Aug 2017 19:40:33 +0000 (12:40 -0700)
If we fail a mount on account of cow recovery errors, it's possible that
a previous quotacheck left some dquots in memory.  The bailout clause of
xfs_mountfs forgets to purge these, and so we leak them.  Fix that.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
fs/xfs/xfs_mount.c

index 151a82db09459030269c0f089407b70ec275128e..ea7d4b4e50d0ca3eedee85ffd840542e0bb105db 100644 (file)
@@ -1024,6 +1024,8 @@ xfs_mountfs(
        IRELE(rip);
        cancel_delayed_work_sync(&mp->m_reclaim_work);
        xfs_reclaim_inodes(mp, SYNC_WAIT);
+       /* Clean out dquots that might be in memory after quotacheck. */
+       xfs_qm_unmount(mp);
  out_log_dealloc:
        mp->m_flags |= XFS_MOUNT_UNMOUNTING;
        xfs_log_mount_cancel(mp);