From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Zhang Yi <yi.zhang@huawei.com>,
linux-xfs@vger.kernel.org, yukuai3@huawei.com
Subject: Re: [PATCH] xfs: flush inode gc workqueue before clearing agi bucket
Date: Tue, 12 Jul 2022 16:09:21 -0700 [thread overview]
Message-ID: <Ys3/IeDLGMXiTUen@magnolia> (raw)
In-Reply-To: <20220712214940.GM3861211@dread.disaster.area>
On Wed, Jul 13, 2022 at 07:49:40AM +1000, Dave Chinner wrote:
> On Tue, Jul 12, 2022 at 11:32:19AM -0700, Darrick J. Wong wrote:
> > On Tue, Jul 12, 2022 at 08:06:42AM +1000, Dave Chinner wrote:
> > > On Mon, Jul 11, 2022 at 10:41:34PM +0800, Zhang Yi wrote:
> > > > In the procedure of recover AGI unlinked lists, if something bad
> > > > happenes on one of the unlinked inode in the bucket list, we would call
> > > > xlog_recover_clear_agi_bucket() to clear the whole unlinked bucket list,
> > > > not the unlinked inodes after the bad one. If we have already added some
> > > > inodes to the gc workqueue before the bad inode in the list, we could
> > > > get below error when freeing those inodes, and finaly fail to complete
> > > > the log recover procedure.
> > > >
> > > > XFS (ram0): Internal error xfs_iunlink_remove at line 2456 of file
> > > > fs/xfs/xfs_inode.c. Caller xfs_ifree+0xb0/0x360 [xfs]
> > > >
> > > > The problem is xlog_recover_clear_agi_bucket() clear the bucket list, so
> > > > the gc worker fail to check the agino in xfs_verify_agino(). Fix this by
> > > > flush workqueue before clearing the bucket.
> > > >
> > > > Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
> > > > ---
> > > > fs/xfs/xfs_log_recover.c | 1 +
> > > > 1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> > > > index 5f7e4e6e33ce..2f655ef4364e 100644
> > > > --- a/fs/xfs/xfs_log_recover.c
> > > > +++ b/fs/xfs/xfs_log_recover.c
> > > > @@ -2714,6 +2714,7 @@ xlog_recover_process_one_iunlink(
> > > > * Call xlog_recover_clear_agi_bucket() to perform a transaction to
> > > > * clear the inode pointer in the bucket.
> > > > */
> > > > + xfs_inodegc_flush(mp);
> > > > xlog_recover_clear_agi_bucket(mp, agno, bucket);
> > > > return NULLAGINO;
> > > > }
> > >
> > > Looks good.
> > >
> > > Reviewed-by: Dave Chinner <dchinner@redhat.com>
> >
> > I propose adding:
> > Fixes: ab23a7768739 ("xfs: per-cpu deferred inode inactivation queues")
> >
> > Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> >
> > >
> > > Darrick, FYI, I actually tripped over this and fixed it in the inode
> > > iunlink series as part of double linking the unlinked inode list in
> > > this patch:
> > >
> > > https://lore.kernel.org/linux-xfs/20220707234345.1097095-6-david@fromorbit.com/
> > >
> > > I didn't realise at the time I was forward porting this code that it
> > > was a pre-existing bug.....
> >
> > Yep. I'll merge this into the tree for easier porting with 5.15, and
> > fix up whatever merge conflicts result, if you're still interested in
> > merging the incore iunlinks for 5.20.
>
> Yes, I'll send you a pull request for it soon now that all reviews
> have been done. If you want, I'll include this fix first and rebase
> the commits that is causes conflicts with on top of it cleanly....
Yes, please include it in the rebase. :)
--D
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com
prev parent reply other threads:[~2022-07-12 23:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-11 14:41 [PATCH] xfs: flush inode gc workqueue before clearing agi bucket Zhang Yi
2022-07-11 22:06 ` Dave Chinner
2022-07-12 18:32 ` Darrick J. Wong
2022-07-12 21:49 ` Dave Chinner
2022-07-12 23:09 ` Darrick J. Wong [this message]
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=Ys3/IeDLGMXiTUen@magnolia \
--to=djwong@kernel.org \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.com \
/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