From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 6/8] xfs: report fs and rt health via geometry structure
Date: Thu, 11 Apr 2019 09:09:10 -0400 [thread overview]
Message-ID: <20190411130910.GF2888@bfoster> (raw)
In-Reply-To: <155494716446.1090518.6511378096384851735.stgit@magnolia>
On Wed, Apr 10, 2019 at 06:46:04PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> Use our newly expanded geometry structure to report the overall fs and
> realtime health status.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/libxfs/xfs_fs.h | 11 ++++++++
> fs/xfs/libxfs/xfs_health.h | 3 ++
> fs/xfs/xfs_health.c | 57 ++++++++++++++++++++++++++++++++++++++++++++
> fs/xfs/xfs_ioctl.c | 2 ++
> 4 files changed, 72 insertions(+), 1 deletion(-)
>
>
...
> diff --git a/fs/xfs/xfs_health.c b/fs/xfs/xfs_health.c
> index 21728228e08b..eb8dbc3a952a 100644
> --- a/fs/xfs/xfs_health.c
> +++ b/fs/xfs/xfs_health.c
> @@ -264,3 +264,60 @@ xfs_inode_measure_sickness(
> *checked = ip->i_checked;
> spin_unlock(&ip->i_flags_lock);
> }
...
> +
> +static inline void
> +xfgeo_health_tick(
> + struct xfs_fsop_geom *geo,
> + unsigned int sick,
> + unsigned int checked,
> + unsigned int sick_mask,
> + unsigned int fsop_mask)
> +{
Could we just pass the struct ioctl_sick_map to this helper? IMO, that
makes the mapping logic a bit more explicit and also doesn't introduce
an unnecessary field name change between ->ioctl_mask and fsop_mask.
FWIW, I might also rename ->ioctl_mask to ->geom_mask since it's
specific to that structure.
> + if (checked & sick_mask)
> + geo->checked |= fsop_mask;
> + if (sick & sick_mask)
> + geo->sick |= fsop_mask;
> +}
> +
...
> diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
> index 0aaf4f88524d..3e3ee197bd0f 100644
> --- a/fs/xfs/xfs_ioctl.c
> +++ b/fs/xfs/xfs_ioctl.c
...
> @@ -792,6 +793,7 @@ xfs_ioc_fsgeometry(
> error = xfs_fs_geometry(&mp->m_sb, &fsgeo, struct_version);
> if (error)
> return error;
> + xfs_fsop_geom_health(mp, &fsgeo);
>
Not really a problem, but it might make sense to not bother with this
unless struct_version >= 5 (via the already existing check below).
Brian
> if (struct_version <= 3)
> len = sizeof(struct xfs_fsop_geom_v1);
>
next prev parent reply other threads:[~2019-04-11 13:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-11 1:45 [PATCH v2 0/8] xfs: online health tracking support Darrick J. Wong
2019-04-11 1:45 ` [PATCH 1/8] xfs: track metadata health status Darrick J. Wong
2019-04-11 12:29 ` Brian Foster
2019-04-11 15:18 ` Darrick J. Wong
2019-04-11 16:05 ` Brian Foster
2019-04-11 18:31 ` Darrick J. Wong
2019-04-11 1:45 ` [PATCH 2/8] xfs: replace the BAD_SUMMARY mount flag with the equivalent health code Darrick J. Wong
2019-04-11 1:45 ` [PATCH 3/8] xfs: clear BAD_SUMMARY if unmounting an unhealthy filesystem Darrick J. Wong
2019-04-11 12:29 ` Brian Foster
2019-04-11 1:45 ` [PATCH 4/8] xfs: bump XFS_IOC_FSGEOMETRY to v5 structures Darrick J. Wong
2019-04-11 12:29 ` Brian Foster
2019-04-11 1:45 ` [PATCH 5/8] xfs: add a new ioctl to describe allocation group geometry Darrick J. Wong
2019-04-11 13:08 ` Brian Foster
2019-04-11 1:46 ` [PATCH 6/8] xfs: report fs and rt health via geometry structure Darrick J. Wong
2019-04-11 13:09 ` Brian Foster [this message]
2019-04-11 15:30 ` Darrick J. Wong
2019-04-11 1:46 ` [PATCH 7/8] xfs: report AG health via AG geometry ioctl Darrick J. Wong
2019-04-11 13:09 ` Brian Foster
2019-04-11 15:33 ` Darrick J. Wong
2019-04-11 1:46 ` [PATCH 8/8] xfs: report inode health via bulkstat Darrick J. Wong
2019-04-11 13:10 ` Brian Foster
-- strict thread matches above, loose matches on Subject: below --
2019-04-12 6:28 [PATCH v3 0/8] xfs: online health tracking support Darrick J. Wong
2019-04-12 6:28 ` [PATCH 6/8] xfs: report fs and rt health via geometry structure Darrick J. Wong
2019-04-12 11:14 ` Brian Foster
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=20190411130910.GF2888@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;
as well as URLs for NNTP newsgroup(s).