From: Christoph Hellwig <hch@infradead.org>
To: Cen Zhang <rollkingzzc@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org,
zerocling0077@gmail.com, 2045gemini@gmail.com
Subject: Re: [PATCH] xfs: drain inodegc before quota teardown on mount failure
Date: Tue, 2 Jun 2026 00:01:51 -0700 [thread overview]
Message-ID: <ah5_31tVIHX1RD7y@infradead.org> (raw)
In-Reply-To: <CAB7XQsFyZgJqraMaDbpR-nPpZNkvbAscjp6qGjSPOAtUPBET1Q@mail.gmail.com>
On Thu, May 28, 2026 at 09:28:02PM +0800, Cen Zhang wrote:
> In my local attempts, a mount-failure errortag after
> xfs_qm_mount_quotas() was not enough by itself, because ordinary test
> setup did not reliably leave an inodegc item that would enter the
> dqattach/eofblocks path during the mount-failure unwind.
>
> The draft I have locally uses two DEBUG-only errortags:
>
> - mount_fail_after_qm_mount_quotas
>
> This injects -EIO immediately after xfs_qm_mount_quotas().
>
> - force_inodegc_eofblocks
>
> This makes a regular inode released after quotacheck scanning go
> through inodegc/eofblocks cleanup, and delays that inodegc work so
> the mount-failure unwind can reach quota teardown first.
This sounds pretty useful, but I actually have a different
question:
> Workqueue: xfs-inodegc/vdc xfs_inodegc_worker
> xfs_qm_dqget_cache_lookup()
> xfs_qm_dqget_inode()
> xfs_qm_dqattach_locked()
> xfs_qm_dqattach()
> xfs_free_eofblocks()
> xfs_inactive()
> xfs_inodegc_worker()
What kind of inode do we actually get here? I guess your test
case reproduces an unclean shutdown and this processes inodes
that otherwise would have been processed on unmount?
I'm kinda tempted to just make xfs_can_free_eofblocks return false
during early mount (or rather during mount failure), as trying
to fix all the corner cases here seems like an uphill battle (
also see the sashiko review)
prev parent reply other threads:[~2026-06-02 7:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 16:07 Zhang Cen
2026-05-19 8:40 ` Christoph Hellwig
2026-05-28 5:31 ` Zhang Cen
2026-05-28 8:32 ` Christoph Hellwig
2026-05-28 13:28 ` Cen Zhang
2026-06-02 7:01 ` Christoph Hellwig [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=ah5_31tVIHX1RD7y@infradead.org \
--to=hch@infradead.org \
--cc=2045gemini@gmail.com \
--cc=cem@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=rollkingzzc@gmail.com \
--cc=zerocling0077@gmail.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
Powered by JetHome