diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2019-04-12 10:41:15 -0400 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-04-14 21:15:57 -0400 |
commit | 39353ff6e96fb623230341ca89b0f4ef3a04998f (patch) | |
tree | 8ced367fba5db52bffb70fc275319aeaaa94f582 /fs/xfs | |
parent | 6772c1f11206f270af56d62bc26737864a63608a (diff) |
xfs: replace the BAD_SUMMARY mount flag with the equivalent health code
Replace the BAD_SUMMARY mount flag with calls to the equivalent health
tracking code.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/libxfs/xfs_sb.c | 5 | ||||
-rw-r--r-- | fs/xfs/xfs_log.c | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.c | 9 | ||||
-rw-r--r-- | fs/xfs/xfs_mount.h | 1 |
4 files changed, 9 insertions, 9 deletions
diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 77a3a4085de3..dc5be0c631c8 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "xfs_refcount_btree.h" | 30 | #include "xfs_refcount_btree.h" |
31 | #include "xfs_da_format.h" | 31 | #include "xfs_da_format.h" |
32 | #include "xfs_da_btree.h" | 32 | #include "xfs_da_btree.h" |
33 | #include "xfs_health.h" | ||
33 | 34 | ||
34 | /* | 35 | /* |
35 | * Physical superblock buffer manipulations. Shared with libxfs in userspace. | 36 | * Physical superblock buffer manipulations. Shared with libxfs in userspace. |
@@ -905,7 +906,7 @@ xfs_initialize_perag_data( | |||
905 | /* | 906 | /* |
906 | * If the new summary counts are obviously incorrect, fail the | 907 | * If the new summary counts are obviously incorrect, fail the |
907 | * mount operation because that implies the AGFs are also corrupt. | 908 | * mount operation because that implies the AGFs are also corrupt. |
908 | * Clear BAD_SUMMARY so that we don't unmount with a dirty log, which | 909 | * Clear FS_COUNTERS so that we don't unmount with a dirty log, which |
909 | * will prevent xfs_repair from fixing anything. | 910 | * will prevent xfs_repair from fixing anything. |
910 | */ | 911 | */ |
911 | if (fdblocks > sbp->sb_dblocks || ifree > ialloc) { | 912 | if (fdblocks > sbp->sb_dblocks || ifree > ialloc) { |
@@ -923,7 +924,7 @@ xfs_initialize_perag_data( | |||
923 | 924 | ||
924 | xfs_reinit_percpu_counters(mp); | 925 | xfs_reinit_percpu_counters(mp); |
925 | out: | 926 | out: |
926 | mp->m_flags &= ~XFS_MOUNT_BAD_SUMMARY; | 927 | xfs_fs_mark_healthy(mp, XFS_SICK_FS_COUNTERS); |
927 | return error; | 928 | return error; |
928 | } | 929 | } |
929 | 930 | ||
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index c3b610b687d1..457ced3ee3e1 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include "xfs_cksum.h" | 23 | #include "xfs_cksum.h" |
24 | #include "xfs_sysfs.h" | 24 | #include "xfs_sysfs.h" |
25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
26 | #include "xfs_health.h" | ||
26 | 27 | ||
27 | kmem_zone_t *xfs_log_ticket_zone; | 28 | kmem_zone_t *xfs_log_ticket_zone; |
28 | 29 | ||
@@ -861,7 +862,7 @@ xfs_log_write_unmount_record( | |||
861 | * recalculated during log recovery at next mount. Refer to | 862 | * recalculated during log recovery at next mount. Refer to |
862 | * xlog_check_unmount_rec for more details. | 863 | * xlog_check_unmount_rec for more details. |
863 | */ | 864 | */ |
864 | if (XFS_TEST_ERROR((mp->m_flags & XFS_MOUNT_BAD_SUMMARY), mp, | 865 | if (XFS_TEST_ERROR(xfs_fs_has_sickness(mp, XFS_SICK_FS_COUNTERS), mp, |
865 | XFS_ERRTAG_FORCE_SUMMARY_RECALC)) { | 866 | XFS_ERRTAG_FORCE_SUMMARY_RECALC)) { |
866 | xfs_alert(mp, "%s: will fix summary counters at next mount", | 867 | xfs_alert(mp, "%s: will fix summary counters at next mount", |
867 | __func__); | 868 | __func__); |
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6581381c12be..14f454e09e6e 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "xfs_refcount_btree.h" | 34 | #include "xfs_refcount_btree.h" |
35 | #include "xfs_reflink.h" | 35 | #include "xfs_reflink.h" |
36 | #include "xfs_extent_busy.h" | 36 | #include "xfs_extent_busy.h" |
37 | #include "xfs_health.h" | ||
37 | 38 | ||
38 | 39 | ||
39 | static DEFINE_MUTEX(xfs_uuid_table_mutex); | 40 | static DEFINE_MUTEX(xfs_uuid_table_mutex); |
@@ -645,7 +646,7 @@ xfs_check_summary_counts( | |||
645 | (mp->m_sb.sb_fdblocks > mp->m_sb.sb_dblocks || | 646 | (mp->m_sb.sb_fdblocks > mp->m_sb.sb_dblocks || |
646 | !xfs_verify_icount(mp, mp->m_sb.sb_icount) || | 647 | !xfs_verify_icount(mp, mp->m_sb.sb_icount) || |
647 | mp->m_sb.sb_ifree > mp->m_sb.sb_icount)) | 648 | mp->m_sb.sb_ifree > mp->m_sb.sb_icount)) |
648 | mp->m_flags |= XFS_MOUNT_BAD_SUMMARY; | 649 | xfs_fs_mark_sick(mp, XFS_SICK_FS_COUNTERS); |
649 | 650 | ||
650 | /* | 651 | /* |
651 | * We can safely re-initialise incore superblock counters from the | 652 | * We can safely re-initialise incore superblock counters from the |
@@ -660,7 +661,7 @@ xfs_check_summary_counts( | |||
660 | */ | 661 | */ |
661 | if ((!xfs_sb_version_haslazysbcount(&mp->m_sb) || | 662 | if ((!xfs_sb_version_haslazysbcount(&mp->m_sb) || |
662 | XFS_LAST_UNMOUNT_WAS_CLEAN(mp)) && | 663 | XFS_LAST_UNMOUNT_WAS_CLEAN(mp)) && |
663 | !(mp->m_flags & XFS_MOUNT_BAD_SUMMARY)) | 664 | !xfs_fs_has_sickness(mp, XFS_SICK_FS_COUNTERS)) |
664 | return 0; | 665 | return 0; |
665 | 666 | ||
666 | return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount); | 667 | return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount); |
@@ -1446,7 +1447,5 @@ xfs_force_summary_recalc( | |||
1446 | if (!xfs_sb_version_haslazysbcount(&mp->m_sb)) | 1447 | if (!xfs_sb_version_haslazysbcount(&mp->m_sb)) |
1447 | return; | 1448 | return; |
1448 | 1449 | ||
1449 | spin_lock(&mp->m_sb_lock); | 1450 | xfs_fs_mark_sick(mp, XFS_SICK_FS_COUNTERS); |
1450 | mp->m_flags |= XFS_MOUNT_BAD_SUMMARY; | ||
1451 | spin_unlock(&mp->m_sb_lock); | ||
1452 | } | 1451 | } |
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index cf7facc36a5f..42b980862203 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h | |||
@@ -228,7 +228,6 @@ typedef struct xfs_mount { | |||
228 | must be synchronous except | 228 | must be synchronous except |
229 | for space allocations */ | 229 | for space allocations */ |
230 | #define XFS_MOUNT_UNMOUNTING (1ULL << 1) /* filesystem is unmounting */ | 230 | #define XFS_MOUNT_UNMOUNTING (1ULL << 1) /* filesystem is unmounting */ |
231 | #define XFS_MOUNT_BAD_SUMMARY (1ULL << 2) /* summary counters are bad */ | ||
232 | #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) | 231 | #define XFS_MOUNT_WAS_CLEAN (1ULL << 3) |
233 | #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem | 232 | #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem |
234 | operations, typically for | 233 | operations, typically for |