From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 02/10] xfs: replace the BAD_SUMMARY mount flag with the equivalent health code
Date: Tue, 2 Apr 2019 09:22:49 -0400 [thread overview]
Message-ID: <20190402132246.GD2899@bfoster> (raw)
In-Reply-To: <155413862191.4966.10871732453060652442.stgit@magnolia>
On Mon, Apr 01, 2019 at 10:10:21AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> 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>
> fs/xfs/libxfs/xfs_sb.c | 5 +++--
> fs/xfs/xfs_log.c | 3 ++-
> fs/xfs/xfs_mount.c | 9 ++++-----
> 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 f96b1997938e..f0309b74e377 100644
> --- a/fs/xfs/libxfs/xfs_sb.c
> +++ b/fs/xfs/libxfs/xfs_sb.c
> @@ -30,6 +30,7 @@
> #include "xfs_refcount_btree.h"
> #include "xfs_da_format.h"
> #include "xfs_da_btree.h"
> +#include "xfs_health.h"
>
> /*
> * Physical superblock buffer manipulations. Shared with libxfs in userspace.
> @@ -907,7 +908,7 @@ xfs_initialize_perag_data(
> /*
> * If the new summary counts are obviously incorrect, fail the
> * mount operation because that implies the AGFs are also corrupt.
> - * Clear BAD_SUMMARY so that we don't unmount with a dirty log, which
> + * Clear FS_COUNTERS so that we don't unmount with a dirty log, which
> * will prevent xfs_repair from fixing anything.
> */
> if (fdblocks > sbp->sb_dblocks || ifree > ialloc) {
> @@ -925,7 +926,7 @@ xfs_initialize_perag_data(
>
> xfs_reinit_percpu_counters(mp);
> out:
> - mp->m_flags &= ~XFS_MOUNT_BAD_SUMMARY;
> + xfs_fs_mark_healthy(mp, XFS_HEALTH_FS_COUNTERS);
> return error;
> }
>
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index c3b610b687d1..0f418842a035 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -23,6 +23,7 @@
> #include "xfs_cksum.h"
> #include "xfs_sysfs.h"
> #include "xfs_sb.h"
> +#include "xfs_health.h"
>
> kmem_zone_t *xfs_log_ticket_zone;
>
> @@ -861,7 +862,7 @@ xfs_log_write_unmount_record(
> * recalculated during log recovery at next mount. Refer to
> * xlog_check_unmount_rec for more details.
> */
> - if (XFS_TEST_ERROR((mp->m_flags & XFS_MOUNT_BAD_SUMMARY), mp,
> + if (XFS_TEST_ERROR(xfs_fs_is_sick(mp, XFS_HEALTH_FS_COUNTERS), mp,
> XFS_ERRTAG_FORCE_SUMMARY_RECALC)) {
> xfs_alert(mp, "%s: will fix summary counters at next mount",
> __func__);
> diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
> index fc1f24dd0386..a43ca655a431 100644
> --- a/fs/xfs/xfs_mount.c
> +++ b/fs/xfs/xfs_mount.c
> @@ -34,6 +34,7 @@
> #include "xfs_refcount_btree.h"
> #include "xfs_reflink.h"
> #include "xfs_extent_busy.h"
> +#include "xfs_health.h"
>
>
> static DEFINE_MUTEX(xfs_uuid_table_mutex);
> @@ -647,7 +648,7 @@ xfs_check_summary_counts(
> (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;
> + xfs_fs_mark_sick(mp, XFS_HEALTH_FS_COUNTERS);
>
> /*
> * We can safely re-initialise incore superblock counters from the
> @@ -662,7 +663,7 @@ xfs_check_summary_counts(
> */
> if ((!xfs_sb_version_haslazysbcount(&mp->m_sb) ||
> XFS_LAST_UNMOUNT_WAS_CLEAN(mp)) &&
> - !(mp->m_flags & XFS_MOUNT_BAD_SUMMARY))
> + !xfs_fs_is_sick(mp, XFS_HEALTH_FS_COUNTERS))
> return 0;
>
> return xfs_initialize_perag_data(mp, mp->m_sb.sb_agcount);
> @@ -1451,7 +1452,5 @@ xfs_force_summary_recalc(
> 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);
> + xfs_fs_mark_sick(mp, XFS_HEALTH_FS_COUNTERS);
> }
> diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
> index 63bbafb01eb5..6e7728340ca7 100644
> --- a/fs/xfs/xfs_mount.h
> +++ b/fs/xfs/xfs_mount.h
> @@ -211,7 +211,6 @@ typedef struct xfs_mount {
> must be synchronous except
> for space allocations */
> #define XFS_MOUNT_UNMOUNTING (1ULL << 1) /* filesystem is unmounting */
> -#define XFS_MOUNT_BAD_SUMMARY (1ULL << 2) /* summary counters are bad */
> #define XFS_MOUNT_WAS_CLEAN (1ULL << 3)
> #define XFS_MOUNT_FS_SHUTDOWN (1ULL << 4) /* atomic stop of all filesystem
> operations, typically for
>
next prev parent reply other threads:[~2019-04-02 13:22 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-01 17:10 [PATCH 00/10] xfs: online health tracking support Darrick J. Wong
2019-04-01 17:10 ` [PATCH 01/10] xfs: track metadata health levels Darrick J. Wong
2019-04-02 13:22 ` Brian Foster
2019-04-02 13:30 ` Darrick J. Wong
2019-04-01 17:10 ` [PATCH 02/10] xfs: replace the BAD_SUMMARY mount flag with the equivalent health code Darrick J. Wong
2019-04-02 13:22 ` Brian Foster [this message]
2019-04-01 17:10 ` [PATCH 03/10] xfs: clear BAD_SUMMARY if unmounting an unhealthy filesystem Darrick J. Wong
2019-04-02 13:24 ` Brian Foster
2019-04-02 13:40 ` Darrick J. Wong
2019-04-02 13:53 ` Brian Foster
2019-04-02 18:16 ` Darrick J. Wong
2019-04-02 18:32 ` Brian Foster
2019-04-01 17:10 ` [PATCH 04/10] xfs: expand xfs_fsop_geom Darrick J. Wong
2019-04-02 17:34 ` Brian Foster
2019-04-02 21:53 ` Dave Chinner
2019-04-02 22:31 ` Darrick J. Wong
2019-04-01 17:10 ` [PATCH 05/10] xfs: add a new ioctl to describe allocation group geometry Darrick J. Wong
2019-04-02 17:34 ` Brian Foster
2019-04-02 21:35 ` Darrick J. Wong
2019-04-01 17:10 ` [PATCH 06/10] xfs: report fs and rt health via geometry structure Darrick J. Wong
2019-04-02 17:35 ` Brian Foster
2019-04-02 18:23 ` Darrick J. Wong
2019-04-02 23:34 ` Darrick J. Wong
2019-04-01 17:10 ` [PATCH 07/10] xfs: report AG health via AG geometry ioctl Darrick J. Wong
2019-04-03 14:30 ` Brian Foster
2019-04-03 16:11 ` Darrick J. Wong
2019-04-04 11:48 ` Brian Foster
2019-04-05 20:33 ` Darrick J. Wong
2019-04-08 11:34 ` Brian Foster
2019-04-09 3:25 ` Darrick J. Wong
2019-04-01 17:11 ` [PATCH 08/10] xfs: report inode health via bulkstat Darrick J. Wong
2019-04-01 17:11 ` [PATCH 09/10] xfs: scrub/repair should update filesystem metadata health Darrick J. Wong
2019-04-04 11:50 ` Brian Foster
2019-04-04 18:01 ` Darrick J. Wong
2019-04-05 13:07 ` Brian Foster
2019-04-05 20:54 ` Darrick J. Wong
2019-04-08 11:35 ` Brian Foster
2019-04-09 3:30 ` Darrick J. Wong
2019-04-01 17:11 ` [PATCH 10/10] xfs: update health status if we get a clean bill of health Darrick J. Wong
2019-04-04 11:51 ` Brian Foster
2019-04-04 15:48 ` Darrick J. Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190402132246.GD2899@bfoster \
--to=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox