diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-20 09:28:40 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-07-23 09:08:01 -0700 |
commit | f467cad95f5e3814fda408dea76eb962ab19685d (patch) | |
tree | d7785b7c90559b5ded75cdf1f90625a41a276ba6 /fs/xfs/xfs_mount.c | |
parent | 53235f22151ea7229e1251e46e68098bcf74922d (diff) | |
download | linux-next-f467cad95f5e3814fda408dea76eb962ab19685d.tar.gz |
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.c | 13 |
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( } return 0; } + +/* Force the summary counters to be recalculated at next mount. */ +void +xfs_force_summary_recalc( + struct xfs_mount *mp) +{ + if (!xfs_sb_version_haslazysbcount(&mp->m_sb)) + return; + + spin_lock(&mp->m_sb_lock); + mp->m_flags |= XFS_MOUNT_BAD_SUMMARY; + spin_unlock(&mp->m_sb_lock); +} |