diff mbox series

[1/6] xfs: recalculate summary counters at mount time if icount is bad

Message ID 153400170370.27471.3984686896617555055.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs-4.19: various fixes | expand

Commit Message

Darrick J. Wong Aug. 11, 2018, 3:35 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

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 <darrick.wong@oracle.com>
---
 fs/xfs/xfs_mount.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Allison Henderson Aug. 12, 2018, 7:53 a.m. UTC | #1
On 08/11/2018 08:35 AM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> 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 <darrick.wong@oracle.com>
> ---
>   fs/xfs/xfs_mount.c |    1 +
>   1 file changed, 1 insertion(+)
> 
> 
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 99db27d6ac8a..02d15098dbee 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;
>   
> 
Ok, looks good

Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Carlos Maiolino Aug. 13, 2018, 7:46 a.m. UTC | #2
On Sat, Aug 11, 2018 at 08:35:03AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> 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 <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_mount.c |    1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> 
> 
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index 99db27d6ac8a..02d15098dbee 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;
>  
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index 99db27d6ac8a..02d15098dbee 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;