From: Darrick J. Wong Date: Sat, 11 Aug 2018 00:55:56 +0000 (-0700) Subject: xfs: recalculate summary counters at mount time if icount is bad X-Git-Tag: v4.19-rc1~67^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=00d22a1c367d03f469f8e1e924b062b09b0545e8;p=thirdparty%2Flinux.git xfs: recalculate summary counters at mount time if icount is bad Since the sb write verifier trips on bad icounts, we should also force a mount time recalculation of the summary counters if the icount is bad. This helps us avoid blowing up at freeze/unmount time when the bad counter gets written back out. Signed-off-by: Darrick J. Wong Reviewed-by: Allison Henderson Reviewed-by: Carlos Maiolino --- diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 99db27d6ac8a4..02d15098dbee3 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -637,6 +637,7 @@ xfs_check_summary_counts( */ if (XFS_LAST_UNMOUNT_WAS_CLEAN(mp) && (mp->m_sb.sb_fdblocks > mp->m_sb.sb_dblocks || + !xfs_verify_icount(mp, mp->m_sb.sb_icount) || mp->m_sb.sb_ifree > mp->m_sb.sb_icount)) mp->m_flags |= XFS_MOUNT_BAD_SUMMARY;