linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 07/12] xfs: scrub the data fork of the realtime inodes
Date: Thu, 10 May 2018 09:54:59 -0400	[thread overview]
Message-ID: <20180510135458.GF69384@bfoster.bfoster> (raw)
In-Reply-To: <152537079876.16676.9808685459752163487.stgit@magnolia>

On Thu, May 03, 2018 at 11:06:38AM -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 |   26 +++++++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> 
> diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
> index 8b048f107af2..b2b4dff2660d 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,27 @@ int
>  xfs_scrub_rtsummary(
>  	struct xfs_scrub_context	*sc)
>  {
> +	struct xfs_inode		*rsumip = sc->mp->m_rsumip;
> +	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.
> +	 */
> +	xfs_ilock(rsumip, XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM);
> +
> +	/* Invoke the fork scrubber. */
> +	sc->ip = rsumip;

I guess the ->ilock_flags are technically inconsistent at this point.
Does that matter? If not, couldn't hurt to document that in the comment.
;P

I also think this would be a bit easier to follow if we just stored and
restored an old_ip pointer on the stack (and perhaps assert that it
matches ->m_rbmip).

Brian

> +	error = xfs_scrub_metadata_inode_forks(sc);
> +	sc->ip = sc->mp->m_rbmip;
> +	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:
> +	xfs_iunlock(rsumip, XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM);
> +	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

  reply	other threads:[~2018-05-10 13:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 18:05 [PATCH v4 00/12] xfs-4.18: various fixes Darrick J. Wong
2018-05-03 18:05 ` [PATCH 01/12] xfs: bmap debugging should never panic the system Darrick J. Wong
2018-05-07 15:06   ` Christoph Hellwig
2018-05-10 13:53   ` Brian Foster
2018-05-10 15:45     ` Darrick J. Wong
2018-05-03 18:06 ` [PATCH 02/12] xfs: add missing rmap error return Darrick J. Wong
2018-05-07 15:06   ` Christoph Hellwig
2018-05-10 13:53   ` Brian Foster
2018-05-03 18:06 ` [PATCH 03/12] xfs: skip scrub xref if corruption already noted Darrick J. Wong
2018-05-10 13:53   ` Brian Foster
2018-05-03 18:06 ` [PATCH 04/12] xfs: don't continue scrub if already corrupt Darrick J. Wong
2018-05-10 13:53   ` Brian Foster
2018-05-10 15:54     ` Darrick J. Wong
2018-05-03 18:06 ` [PATCH 05/12] xfs: avoid ilock games in the quota scrubber Darrick J. Wong
2018-05-03 18:06 ` [PATCH 06/12] xfs: quota scrub should use bmapbtd scrubber Darrick J. Wong
2018-05-10 13:54   ` Brian Foster
2018-05-10 15:34     ` Darrick J. Wong
2018-05-03 18:06 ` [PATCH 07/12] xfs: scrub the data fork of the realtime inodes Darrick J. Wong
2018-05-10 13:54   ` Brian Foster [this message]
2018-05-10 16:07     ` Darrick J. Wong
2018-05-03 18:06 ` [PATCH 08/12] xfs: superblock scrub should use short-lived buffers Darrick J. Wong
2018-05-10 13:55   ` Brian Foster
2018-05-03 18:06 ` [PATCH 09/12] xfs: clean up scrub usage of KM_NOFS Darrick J. Wong
2018-05-03 18:06 ` [PATCH 10/12] xfs: btree scrub should check minrecs Darrick J. Wong
2018-05-03 18:07 ` [PATCH 11/12] xfs: refactor scrub transaction allocation function Darrick J. Wong
2018-05-03 18:07 ` [PATCH 12/12] xfs: avoid ABBA deadlock when scrubbing parent pointers Darrick J. Wong
2018-05-08  0:40 ` [PATCH 13/12] xfs: refactor quota limits initialization 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=20180510135458.GF69384@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).