From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/8] xfs: scrub the data fork of the realtime inodes
Date: Fri, 11 May 2018 11:19:39 -0400 [thread overview]
Message-ID: <20180511151939.GE105683@bfoster.bfoster> (raw)
In-Reply-To: <152597990586.25215.6135406269069566239.stgit@magnolia>
On Thu, May 10, 2018 at 12:18:25PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> The realtime bitmap and summary inodes live on the metadata device, so
> we can scrub their data forks with the regular scrubbers.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
> fs/xfs/scrub/rtbitmap.c | 34 +++++++++++++++++++++++++++++++++-
> 1 file changed, 33 insertions(+), 1 deletion(-)
>
>
> diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
> index 8b048f107af2..abc885dab122 100644
> --- a/fs/xfs/scrub/rtbitmap.c
> +++ b/fs/xfs/scrub/rtbitmap.c
> @@ -82,6 +82,11 @@ xfs_scrub_rtbitmap(
> {
> int error;
>
> + /* Invoke the fork scrubber. */
> + error = xfs_scrub_metadata_inode_forks(sc);
> + if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> + return error;
> +
> error = xfs_rtalloc_query_all(sc->tp, xfs_scrub_rtbitmap_rec, sc);
> if (!xfs_scrub_fblock_process_error(sc, XFS_DATA_FORK, 0, &error))
> goto out;
> @@ -95,8 +100,35 @@ int
> xfs_scrub_rtsummary(
> struct xfs_scrub_context *sc)
> {
> + struct xfs_inode *rsumip = sc->mp->m_rsumip;
> + uint old_ilock_flags;
> + int error = 0;
> +
> + /*
> + * We ILOCK'd the rt bitmap ip in the setup routine, now lock the
> + * rt summary ip in compliance with the rt inode locking rules.
> + *
> + * Since we switch sc->ip to rsumip we have to save the old ilock
> + * flags so that we don't mix up the inode state that @sc tracks.
> + */
> + old_ilock_flags = sc->ilock_flags;
> + sc->ip = rsumip;
> + sc->ilock_flags = XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM;
> + xfs_ilock(sc->ip, sc->ilock_flags);
> +
> + /* Invoke the fork scrubber. */
> + error = xfs_scrub_metadata_inode_forks(sc);
> + if (error || (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
> + goto out;
> +
> /* XXX: implement this some day */
> - return -ENOENT;
> + xfs_scrub_set_incomplete(sc);
> +out:
> + /* Switch back to the rtbitmap inode and lock flags. */
> + xfs_iunlock(sc->ip, sc->ilock_flags);
> + sc->ilock_flags = old_ilock_flags;
> + sc->ip = sc->mp->m_rbmip;
I'd use an old_ip here as well just to avoid hardcoding against some
other function. With that, looks fine:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> + return error;
> }
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-05-11 15:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 19:18 [PATCH v5 0/8] xfs-4.18: scrub fixes Darrick J. Wong
2018-05-10 19:18 ` [PATCH 1/8] xfs: refactor quota limits initialization Darrick J. Wong
2018-05-11 15:19 ` Brian Foster
2018-05-11 22:43 ` Darrick J. Wong
2018-05-11 23:44 ` [PATCH v2 " Darrick J. Wong
2018-05-14 10:25 ` Brian Foster
2018-05-10 19:18 ` [PATCH 2/8] xfs: don't continue scrub if already corrupt Darrick J. Wong
2018-05-11 15:19 ` Brian Foster
2018-05-10 19:18 ` [PATCH 3/8] xfs: quota scrub should use bmapbtd scrubber Darrick J. Wong
2018-05-11 15:19 ` Brian Foster
2018-05-10 19:18 ` [PATCH 4/8] xfs: scrub the data fork of the realtime inodes Darrick J. Wong
2018-05-11 15:19 ` Brian Foster [this message]
2018-05-10 19:18 ` [PATCH 5/8] xfs: avoid ABBA deadlock when scrubbing parent pointers Darrick J. Wong
2018-05-11 15:20 ` Brian Foster
2018-05-10 19:18 ` [PATCH 6/8] xfs: hoist xfs_scrub_agfl_walk to libxfs as xfs_agfl_walk Darrick J. Wong
2018-05-11 15:20 ` Brian Foster
2018-05-10 19:18 ` [PATCH 7/8] xfs: make xfs_bmapi_remapi work with attribute forks Darrick J. Wong
2018-05-11 15:20 ` Brian Foster
2018-05-10 19:18 ` [PATCH 8/8] xfs: teach xfs_bmapi_remap to accept some bmapi flags Darrick J. Wong
2018-05-11 15:20 ` Brian Foster
2018-05-11 23:14 ` Darrick J. Wong
2018-05-14 10:26 ` Brian Foster
2018-05-11 23:46 ` [PATCH v2 " Darrick J. Wong
2018-05-14 10:26 ` 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=20180511151939.GE105683@bfoster.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).