From: Brian Foster <bfoster@redhat.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 1/4] repair: set the in-core inode parent in phase 3
Date: Wed, 15 Jul 2020 10:08:33 -0400 [thread overview]
Message-ID: <20200715140836.10197-2-bfoster@redhat.com> (raw)
In-Reply-To: <20200715140836.10197-1-bfoster@redhat.com>
The inode processing code checks and resets invalid parent values on
physical inodes in phase 3 but waits to update the parent value in
the in-core tracking until phase 4. There doesn't appear to be any
specific reason for the latter beyond caution. In reality, the only
reason this doesn't cause problems is that phase 3 replaces an
invalid on-disk parent with another invalid value, so the in-core
parent returned by phase 4 translates to NULLFSINO.
This is subtle and fragile. To eliminate this duplicate processing
behavior and break the subtle dependency of requiring an invalid
dummy value in physical directory inodes, update the in-core parent
tracking structure at the same point in phase 3 that physical inodes
are updated. Invalid on-disk parent values will still translate to
NULLFSINO for the in-core tracking to be identified by later phases.
This ensures that if a valid dummy value is placed in a physical
inode (such as rootino) with an invalid parent in phase 3, phase 4
won't mistakenly return the valid dummy value to be incorrectly set
in the in-core tracking over the NULLFSINO value that represents the
broken on-disk state.
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
repair/dino_chunks.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
index 6685a4d2..96ed6a5b 100644
--- a/repair/dino_chunks.c
+++ b/repair/dino_chunks.c
@@ -859,14 +859,7 @@ next_readbuf:
*/
if (isa_dir) {
set_inode_isadir(ino_rec, irec_offset);
- /*
- * we always set the parent but
- * we may as well wait until
- * phase 4 (no inode discovery)
- * because the parent info will
- * be solid then.
- */
- if (!ino_discovery) {
+ if (ino_discovery) {
ASSERT(parent != 0);
set_inode_parent(ino_rec, irec_offset, parent);
ASSERT(parent ==
--
2.21.3
next prev parent reply other threads:[~2020-07-15 14:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 14:08 [PATCH 0/4] xfsprogs: remove custom dir2 sf fork verifier from repair Brian Foster
2020-07-15 14:08 ` Brian Foster [this message]
2020-07-15 18:42 ` [PATCH 1/4] repair: set the in-core inode parent in phase 3 Christoph Hellwig
2020-07-21 0:57 ` Darrick J. Wong
2020-07-15 14:08 ` [PATCH 2/4] repair: don't double check dir2 sf parent in phase 4 Brian Foster
2020-07-15 18:43 ` Christoph Hellwig
2020-07-15 23:54 ` Darrick J. Wong
2020-07-16 10:39 ` Brian Foster
2020-07-21 0:55 ` Darrick J. Wong
2020-07-15 14:08 ` [PATCH 3/4] repair: use fs root ino for dummy parent value instead of zero Brian Foster
2020-07-15 18:44 ` Christoph Hellwig
2020-07-15 22:22 ` Dave Chinner
2020-07-16 10:41 ` Brian Foster
2020-07-16 22:06 ` Dave Chinner
2020-07-17 11:57 ` Brian Foster
2020-07-17 11:59 ` [PATCH v2] repair: use fs rootino " Brian Foster
2020-07-20 3:21 ` Dave Chinner
2020-07-21 0:47 ` Darrick J. Wong
2020-07-15 14:08 ` [PATCH 4/4] repair: remove custom dir2 sf fork verifier from phase6 Brian Foster
2020-07-15 18:44 ` Christoph Hellwig
2020-07-21 0:47 ` 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=20200715140836.10197-2-bfoster@redhat.com \
--to=bfoster@redhat.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).