aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-07-20 12:28:40 -0400
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-23 12:08:01 -0400
commitf467cad95f5e3814fda408dea76eb962ab19685d (patch)
treed7785b7c90559b5ded75cdf1f90625a41a276ba6 /fs/xfs/xfs_mount.c
parent53235f22151ea7229e1251e46e68098bcf74922d (diff)
xfs: force summary counter recalc at next mount
Use the "bad summary count" mount flag from the previous patch to skip writing the unmount record to force log recovery at the next mount, which will recalculate the summary counters for us. 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.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 60462c35ad4b..4fb361cde32a 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1423,3 +1423,16 @@ xfs_dev_is_read_only(
1423 } 1423 }
1424 return 0; 1424 return 0;
1425} 1425}
1426
1427/* Force the summary counters to be recalculated at next mount. */
1428void
1429xfs_force_summary_recalc(
1430 struct xfs_mount *mp)
1431{
1432 if (!xfs_sb_version_haslazysbcount(&mp->m_sb))
1433 return;
1434
1435 spin_lock(&mp->m_sb_lock);
1436 mp->m_flags |= XFS_MOUNT_BAD_SUMMARY;
1437 spin_unlock(&mp->m_sb_lock);
1438}