From: "Darrick J. Wong" <djwong@kernel.org>
To: Chandan Babu R <chandan.babu@oracle.com>
Cc: linux-xfs@vger.kernel.org, sandeen@sandeen.net
Subject: Re: [PATCH V1.1] xfs_repair: Search for conflicts in inode_tree_ptrs[] when processing uncertain inodes
Date: Mon, 23 May 2022 13:28:47 -0700 [thread overview]
Message-ID: <Yovuf/JZiMkJzot6@magnolia> (raw)
In-Reply-To: <20220523083410.1159518-1-chandan.babu@oracle.com>
On Mon, May 23, 2022 at 02:04:10PM +0530, Chandan Babu R wrote:
> When processing an uncertain inode chunk record, if we lose 2 blocks worth of
> inodes or 25% of the chunk, xfs_repair decides to ignore the chunk. Otherwise,
> xfs_repair adds a new chunk record to inode_tree_ptrs[agno], marking each
> inode as either free or used. However, before adding the new chunk record,
> xfs_repair has to check for the existance of a conflicting record.
>
> The existing code incorrectly checks for the conflicting record in
> inode_uncertain_tree_ptrs[agno]. This check will succeed since the inode chunk
> record being processed was originally obtained from
> inode_uncertain_tree_ptrs[agno].
>
> This commit fixes the bug by changing xfs_repair to search
> inode_tree_ptrs[agno] for conflicts.
Just out of curiosity -- how did you come across this bug? I /think/ it
looks reasonable, but want to know more context...
> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
> ---
> Changelog:
> V1 -> V1.1:
> 1. Fix commit message.
>
> repair/dino_chunks.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
> index 11b0eb5f..80c52a43 100644
> --- a/repair/dino_chunks.c
> +++ b/repair/dino_chunks.c
> @@ -229,8 +229,7 @@ verify_inode_chunk(xfs_mount_t *mp,
> /*
> * ok, put the record into the tree, if no conflict.
> */
> - if (find_uncertain_inode_rec(agno,
> - XFS_AGB_TO_AGINO(mp, start_agbno)))
> + if (find_inode_rec(mp, agno, XFS_AGB_TO_AGINO(mp, start_agbno)))
...because the big question I have is: why not check both the certain
and the uncertain records for confliects?
--D
> return(0);
>
> start_agino = XFS_AGB_TO_AGINO(mp, start_agbno);
> --
> 2.35.1
>
next prev parent reply other threads:[~2022-05-23 20:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-23 4:34 [PATCH] xfs_repair: Search for conflicts in inode_tree_ptrs[] when processing uncertain inodes Chandan Babu R
2022-05-23 8:34 ` [PATCH V1.1] " Chandan Babu R
2022-05-23 20:28 ` Darrick J. Wong [this message]
2022-05-23 23:08 ` Dave Chinner
2022-05-26 12:04 ` Chandan Babu R
2022-05-26 16:57 ` Darrick J. Wong
2022-05-27 5:51 ` Chandan Babu R
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=Yovuf/JZiMkJzot6@magnolia \
--to=djwong@kernel.org \
--cc=chandan.babu@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox