All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 19/20] xfs: cross-reference realtime bitmap to realtime rmapbt scrubber
Date: Mon, 31 Dec 2018 18:26:24 -0800	[thread overview]
Message-ID: <154630958412.8108.13637841471385650638.stgit@magnolia> (raw)
In-Reply-To: <154630945466.8108.16578904812191021263.stgit@magnolia>

From: Darrick J. Wong <darrick.wong@oracle.com>

When we're checking the realtime rmapbt, cross-reference the entries
with the realtime bitmap too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/scrub/rtbitmap.c |    5 +----
 fs/xfs/scrub/rtrmap.c   |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)


diff --git a/fs/xfs/scrub/rtbitmap.c b/fs/xfs/scrub/rtbitmap.c
index 665d4bbb17cc..35c243a404e7 100644
--- a/fs/xfs/scrub/rtbitmap.c
+++ b/fs/xfs/scrub/rtbitmap.c
@@ -144,13 +144,10 @@ xchk_xref_is_used_rt_space(
 	if (do_div(endext, sc->mp->m_sb.sb_rextsize))
 		endext++;
 	extcount = endext - startext;
-	xfs_ilock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
 	error = xfs_rtalloc_extent_is_free(sc->mp, sc->tp, startext, extcount,
 			&is_free);
 	if (!xchk_should_check_xref(sc, &error, NULL))
-		goto out_unlock;
+		return;
 	if (is_free)
 		xchk_ino_xref_set_corrupt(sc, sc->mp->m_rbmip->i_ino);
-out_unlock:
-	xfs_iunlock(sc->mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
 }
diff --git a/fs/xfs/scrub/rtrmap.c b/fs/xfs/scrub/rtrmap.c
index 95e182a306b9..1204f9648c83 100644
--- a/fs/xfs/scrub/rtrmap.c
+++ b/fs/xfs/scrub/rtrmap.c
@@ -56,6 +56,16 @@ xchk_setup_rtrmapbt(
 
 /* Realtime reverse mapping. */
 
+/* Cross-reference with other metadata. */
+STATIC void
+xchk_rtrmapbt_xref(
+	struct xfs_scrub	*sc,
+	struct xfs_rmap_irec	*irec)
+{
+	xchk_xref_is_used_rt_space(sc, irec->rm_startblock,
+			irec->rm_blockcount);
+}
+
 /* Scrub a realtime rmapbt record. */
 STATIC int
 xchk_rtrmapbt_helper(
@@ -86,6 +96,10 @@ xchk_rtrmapbt_helper(
 	if (is_bmbt || non_inode || is_attr)
 		xchk_btree_set_corrupt(bs->sc, bs->cur, 0);
 
+	if (bs->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
+		goto out;
+
+	xchk_rtrmapbt_xref(bs->sc, &irec);
 out:
 	return error;
 }

  parent reply	other threads:[~2019-01-01  2:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-01  2:24 [PATCH v10 00/20] xfs: add realtime reverse-mapping support Darrick J. Wong
2019-01-01  2:24 ` [PATCH 01/20] xfs: make iroot_realloc a btree function Darrick J. Wong
2019-01-01  2:24 ` [PATCH 02/20] xfs: support storing records in the inode core root Darrick J. Wong
2019-01-01  2:24 ` [PATCH 03/20] xfs: widen xfs_rmap_irec fields to handle realtime rmapbt Darrick J. Wong
2019-01-01  2:24 ` [PATCH 04/20] xfs: introduce realtime rmap btree definitions Darrick J. Wong
2019-01-01  2:24 ` [PATCH 05/20] xfs: define the on-disk realtime rmap btree format Darrick J. Wong
2019-01-01  2:24 ` [PATCH 06/20] xfs: realtime rmap btree transaction reservations Darrick J. Wong
2019-01-01  2:25 ` [PATCH 07/20] xfs: add realtime rmap btree operations Darrick J. Wong
2019-01-01  2:25 ` [PATCH 08/20] xfs: prepare rmap functions to deal with rtrmapbt Darrick J. Wong
2019-01-01  2:25 ` [PATCH 09/20] xfs: add a realtime flag to the rmap update log redo items Darrick J. Wong
2019-01-01  2:25 ` [PATCH 10/20] xfs: add realtime rmap btree block detection to log recovery Darrick J. Wong
2019-01-01  2:25 ` [PATCH 11/20] xfs: add realtime reverse map inode to superblock Darrick J. Wong
2019-01-01  2:25 ` [PATCH 12/20] xfs: wire up a new inode fork type for the realtime rmap Darrick J. Wong
2019-01-01  2:25 ` [PATCH 13/20] xfs: wire up rmap map and unmap to the realtime rmapbt Darrick J. Wong
2019-01-01  2:25 ` [PATCH 14/20] xfs: create routine to allocate and initialize a realtime rmap btree inode Darrick J. Wong
2019-01-01  2:25 ` [PATCH 15/20] xfs: dynamically create the realtime rmapbt inode when attaching rtdev Darrick J. Wong
2019-01-01  2:26 ` [PATCH 16/20] xfs: enable realtime rmap btree Darrick J. Wong
2019-01-01  2:26 ` [PATCH 17/20] xfs: wire up getfsmap to the realtime reverse mapping btree Darrick J. Wong
2019-01-01  2:26 ` [PATCH 18/20] xfs: scrub the realtime rmapbt Darrick J. Wong
2019-01-01  2:26 ` Darrick J. Wong [this message]
2019-01-01  2:26 ` [PATCH 20/20] xfs: cross-reference " Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2016-08-25 23:43 [PATCH v8 00/20] xfs: add realtime reverse-mapping support Darrick J. Wong
2016-08-25 23:45 ` [PATCH 19/20] xfs: cross-reference realtime bitmap to realtime rmapbt scrubber 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=154630958412.8108.13637841471385650638.stgit@magnolia \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.