From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: cem@kernel.org, stable@vger.kernel.org,
linux-xfs@vger.kernel.org, Hans Holmberg <hans.holmberg@wdc.com>,
Damien Le Moal <dlemoal@kernel.org>
Subject: Re: [PATCH 09/12] xfs: break out of zoned reservation loop if signals are pending
Date: Fri, 25 Sep 2026 12:37:22 -0700 [thread overview]
Message-ID: <20260925193722.GP2705364@frogsfrogsfrogs> (raw)
In-Reply-To: <20260925191830.GO2705364@frogsfrogsfrogs>
On Fri, Sep 25, 2026 at 12:18:30PM -0700, Darrick J. Wong wrote:
> On Thu, Sep 24, 2026 at 10:41:54PM -0700, Christoph Hellwig wrote:
> > On Thu, Sep 24, 2026 at 09:12:51PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > >
> > > I noticed that if you run generic/476 for long enough on a zoned
> > > filesystem that it runs out of space in the zoned section, fsstress gets
> > > stuck in this loop trying to reserve space, failing, and kicking off the
> > > gc.
> >
> > I guess this is not directly fixed here, right?
>
> Correct. There's enough space freeing activity going on (truncate,
> punch, unlink, etc) so that the gc actually does clear out zones; but
> there are also enough writers consuming more space that they all end up
> in this loop at some point, and some of the threads never manage to get
> what they want from rtavailable.
>
> > > The garbage collector in turn is continuously running (so we don't
> > > break out of the loop) but the process is no longer responsive to
> > > signals and can't be killed.
> > >
> > > Fix this by backing out to userspace for any pending signal. This
> > > should be safe because space reservation is usually the first step in
> > > any modification to a zoned file.
> > >
> > > Cc: <hch@lst.de>
> > > Cc: <stable@vger.kernel.org> # v6.15
> > > Fixes: 0bb2193056b596 ("xfs: add support for zoned space reservations")
> > > Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
> > > ---
> > > fs/xfs/xfs_zone_space_resv.c | 5 +++++
> > > 1 file changed, 5 insertions(+)
> > >
> > >
> > > diff --git a/fs/xfs/xfs_zone_space_resv.c b/fs/xfs/xfs_zone_space_resv.c
> > > index 7aa3c74fb2e01a..8edc82025abbd5 100644
> > > --- a/fs/xfs/xfs_zone_space_resv.c
> > > +++ b/fs/xfs/xfs_zone_space_resv.c
> > > @@ -157,6 +157,11 @@ xfs_zoned_reserve_available(
> > > if (error != -ENOSPC)
> > > break;
> > >
> > > + if (signal_pending(current)) {
> > > + error = -ERESTARTSYS;
> > > + break;
> > > + }
> >
> > I don't think normal fs read/write semantics allow for -ERESTARTSYS
> > on arbitrary signals. So this should probably be limited to
> > fatal_signal_pending().
>
> Ok. That at least means I can ^C the g/476 test processes. :)
Heh. Rereading my notes it was always possible to kill -9 the process,
but the difficulty with fsstress is that it uses SIGTERM sets a global
flag to tell its threads to exit their file IO loops. Since that's not
a fatal action, fatal_signal_pending() returns false and so the thread
remains stuck looping in the kernel.
--D
next prev parent reply other threads:[~2026-09-25 19:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 4:10 [PATCHSET] xfs: LLM-inspired bug fixes, part 18 Darrick J. Wong
2026-09-25 4:10 ` [PATCH 01/12] xfs: adjust checks for cross-AG reaping issues Darrick J. Wong
2026-09-25 5:33 ` Christoph Hellwig
2026-09-25 4:11 ` [PATCH 02/12] xfs: actually check XFS_DIFLAG2_METADATA for metadata btree data forks Darrick J. Wong
2026-09-25 5:33 ` Christoph Hellwig
2026-09-25 4:11 ` [PATCH 03/12] xfs: fix xchk_stats_estimate_bufsize to allow for the trailing null Darrick J. Wong
2026-09-25 5:34 ` Christoph Hellwig
2026-09-25 4:11 ` [PATCH 04/12] xfs: cross-reference the primary superblock Darrick J. Wong
2026-09-25 5:35 ` Christoph Hellwig
2026-09-25 4:11 ` [PATCH 05/12] xfs: write the rt super immediately during repair Darrick J. Wong
2026-09-25 5:36 ` Christoph Hellwig
2026-09-25 4:12 ` [PATCH 06/12] xfs: read rt superblock from disk during scrub Darrick J. Wong
2026-09-25 5:37 ` Christoph Hellwig
2026-09-25 4:12 ` [PATCH 07/12] xfs: write the primary super immediately during repair Darrick J. Wong
2026-09-25 5:38 ` Christoph Hellwig
2026-09-25 4:12 ` [PATCH 08/12] xfs: read primary superblock from disk during scrub Darrick J. Wong
2026-09-25 5:39 ` Christoph Hellwig
2026-09-25 4:12 ` [PATCH 09/12] xfs: break out of zoned reservation loop if signals are pending Darrick J. Wong
2026-09-25 5:41 ` Christoph Hellwig
2026-09-25 19:18 ` Darrick J. Wong
2026-09-25 19:37 ` Darrick J. Wong [this message]
2026-09-25 4:13 ` [PATCH 10/12] xfs: jump out of xchk_bmap_check_rmap if fatal signals Darrick J. Wong
2026-09-25 5:42 ` Christoph Hellwig
2026-09-25 4:13 ` [PATCH 11/12] xfs: mark overfull dabtree node blocks as corrupt Darrick J. Wong
2026-09-25 5:42 ` Christoph Hellwig
2026-09-25 4:13 ` [PATCH 12/12] xfs: check fork type against dabtree block magic number Darrick J. Wong
2026-09-25 5:42 ` Christoph Hellwig
2026-10-08 13:32 ` [PATCHSET] xfs: LLM-inspired bug fixes, part 18 Carlos Maiolino
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=20260925193722.GP2705364@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=dlemoal@kernel.org \
--cc=hans.holmberg@wdc.com \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@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