All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: [PATCH 05/12] xfs_repair: inject lost blocks back into the fs no matter the owner
Date: Mon, 01 Jun 2020 21:27:24 -0700	[thread overview]
Message-ID: <159107204483.315004.966896847007086323.stgit@magnolia> (raw)
In-Reply-To: <159107201290.315004.4447998785149331259.stgit@magnolia>

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

In repair phase 5, inject_lost_blocks takes the blocks that we allocated
but didn't use for constructing the new AG btrees and puts them back in
the filesystem by adding them to the free space.  The only btree that
can overestimate like that are the free space btrees, but in principle,
any of the btrees can do that.  If the others did, the rmap record owner
for those blocks won't necessarily be OWNER_AG, and if it isn't, repair
will fail.

Get rid of this logic bomb so that we can use it for /any/ block count
overestimation, and then we can use it to clean up after all
reconstruction of any btree type.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/phase5.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


diff --git a/repair/phase5.c b/repair/phase5.c
index 44a6bda8..75c480fd 100644
--- a/repair/phase5.c
+++ b/repair/phase5.c
@@ -2516,8 +2516,8 @@ inject_lost_blocks(
 		if (error)
 			goto out_cancel;
 
-		error = -libxfs_free_extent(tp, *fsb, 1, &XFS_RMAP_OINFO_AG,
-					    XFS_AG_RESV_NONE);
+		error = -libxfs_free_extent(tp, *fsb, 1,
+				&XFS_RMAP_OINFO_ANY_OWNER, XFS_AG_RESV_NONE);
 		if (error)
 			goto out_cancel;
 


  parent reply	other threads:[~2020-06-02  4:27 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02  4:26 [PATCH v6 00/12] xfs_repair: use btree bulk loading Darrick J. Wong
2020-06-02  4:26 ` [PATCH 01/12] xfs_repair: drop lostblocks from build_agf_agfl Darrick J. Wong
2020-06-17 12:09   ` Brian Foster
2020-06-02  4:27 ` [PATCH 02/12] xfs_repair: rename the agfl index loop variable in build_agf_agfl Darrick J. Wong
2020-06-17 12:09   ` Brian Foster
2020-06-02  4:27 ` [PATCH 03/12] xfs_repair: make container for btree bulkload root and block reservation Darrick J. Wong
2020-06-17 12:09   ` Brian Foster
2020-06-02  4:27 ` [PATCH 04/12] xfs_repair: remove gratuitous code block in phase5 Darrick J. Wong
2020-06-02  4:27 ` Darrick J. Wong [this message]
2020-06-17 12:09   ` [PATCH 05/12] xfs_repair: inject lost blocks back into the fs no matter the owner Brian Foster
2020-06-02  4:27 ` [PATCH 06/12] xfs_repair: create a new class of btree rebuild cursors Darrick J. Wong
2020-06-17 12:10   ` Brian Foster
2020-06-18 18:30     ` Darrick J. Wong
2020-06-29 23:10     ` Darrick J. Wong
2020-07-02 15:18   ` [PATCH v2 " Darrick J. Wong
2020-07-03  3:24     ` Eric Sandeen
2020-07-03 20:26       ` Darrick J. Wong
2020-07-03 21:51         ` Eric Sandeen
2020-07-04  3:39           ` Darrick J. Wong
2020-07-10 19:10     ` Eric Sandeen
2020-07-13 13:37       ` Brian Foster
2020-06-02  4:27 ` [PATCH 07/12] xfs_repair: rebuild free space btrees with bulk loader Darrick J. Wong
2020-06-18 15:23   ` Brian Foster
2020-06-18 16:41     ` Darrick J. Wong
2020-06-18 16:51       ` Brian Foster
2020-06-02  4:27 ` [PATCH 08/12] xfs_repair: rebuild inode " Darrick J. Wong
2020-06-18 15:24   ` Brian Foster
2020-06-18 18:33     ` Darrick J. Wong
2020-06-02  4:27 ` [PATCH 09/12] xfs_repair: rebuild reverse mapping " Darrick J. Wong
2020-06-18 15:25   ` Brian Foster
2020-06-18 15:31     ` Darrick J. Wong
2020-06-18 15:37       ` Brian Foster
2020-06-18 16:54         ` Darrick J. Wong
2020-06-02  4:27 ` [PATCH 10/12] xfs_repair: rebuild refcount " Darrick J. Wong
2020-06-18 15:26   ` Brian Foster
2020-06-18 16:56     ` Darrick J. Wong
2020-06-18 17:05       ` Brian Foster
2020-06-02  4:28 ` [PATCH 11/12] xfs_repair: remove old btree rebuild support code Darrick J. Wong
2020-06-19 11:10   ` Brian Foster
2020-06-02  4:28 ` [PATCH 12/12] xfs_repair: use bitmap to track blocks lost during btree construction Darrick J. Wong
2020-06-19 11:10   ` Brian Foster
2020-06-19 21:36     ` 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=159107204483.315004.966896847007086323.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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.