From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs@vger.kernel.org, chandanbabu@kernel.org
Subject: Re: [PATCH 2/4] xfs: xfs_alloc_file_space() fails to detect ENOSPC
Date: Wed, 3 Apr 2024 17:34:09 +1100 [thread overview]
Message-ID: <Zgz4YXUp+fFEN3qp@dread.disaster.area> (raw)
In-Reply-To: <ZgzdtYGyVN1-UQdM@infradead.org>
On Tue, Apr 02, 2024 at 09:40:21PM -0700, Christoph Hellwig wrote:
> On Wed, Apr 03, 2024 at 08:38:17AM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> >
> > xfs_alloc_file_space ends up in an endless loop when
> > xfs_bmapi_write() returns nimaps == 0 at ENOSPC. The process is
> > unkillable, and so just runs around in a tight circle burning CPU
> > until the system is rebooted.
>
> What is your reproducer? Let's just fix this for real.
Run the reproducer in this bug report on a TOT kernel, and the
XFS_IOC_RESVSP call will livelock:
https://lore.kernel.org/linux-xfs/CAEJPjCvT3Uag-pMTYuigEjWZHn1sGMZ0GCjVVCv29tNHK76Cgg@mail.gmail.com/
That has nothing to do with delalloc - free space accounting was
screwed up by a reserve blocks ioctl, and so when allocation fails
it just runs around in a tight circle and cannot be broken out of.
Regardless of the reproducer that corrupts free space accounting,
there is no guarantee that allocations will succeed even if there is
free space available. Hence this loop must have a way to break out
when allocation fails. This becomes even more apparent with the
forced alignment feature - as soon as we run out of contiguous free
space for aligned allocation, allocations will persistently fail
when there is plenty of free space still available.
Given that the fix was for something that doesn't currently exist
(RT delalloc) the only sane thing to do right now is revert the fix
and push that revert back to the stable kernels that are susceptible
to this livelock.
I don't know exactly how the orginal delalloc issue was triggered,
let alone had the time to time to understand how to actually
fix it properly. The code as it stands contains a regression and so
the first thing we need to do is revert the change so we can
backport it....
-Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2024-04-03 6:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 21:38 [PATCH 0/4] xfs: fixes for 6.9-rcX Dave Chinner
2024-04-02 21:38 ` [PATCH 1/4] xfs: use kvmalloc for xattr buffers Dave Chinner
2024-04-03 3:43 ` Darrick J. Wong
2024-04-03 4:39 ` Christoph Hellwig
2024-04-03 6:16 ` Dave Chinner
2024-04-03 6:19 ` Christoph Hellwig
2024-04-17 14:35 ` Pankaj Raghav (Samsung)
2024-04-02 21:38 ` [PATCH 2/4] xfs: xfs_alloc_file_space() fails to detect ENOSPC Dave Chinner
2024-04-03 3:46 ` Darrick J. Wong
2024-04-03 4:40 ` Christoph Hellwig
2024-04-03 6:34 ` Dave Chinner [this message]
2024-04-03 18:23 ` Christoph Hellwig
2024-04-02 21:38 ` [PATCH 3/4] xfs: handle allocation failure in xfs_dquot_disk_alloc() Dave Chinner
2024-04-03 3:48 ` Darrick J. Wong
2024-04-03 4:41 ` Christoph Hellwig
2024-04-03 4:54 ` Darrick J. Wong
2024-04-03 4:56 ` Christoph Hellwig
2024-04-03 5:04 ` Darrick J. Wong
2024-04-03 6:41 ` Dave Chinner
2024-04-03 14:06 ` Christoph Hellwig
2024-04-03 21:49 ` Dave Chinner
2024-04-02 21:38 ` [PATCH 4/4] xfs: validate block count for XFS_IOC_SET_RESBLKS Dave Chinner
2024-04-03 3:53 ` Darrick J. Wong
2024-04-03 6:55 ` Dave Chinner
2024-04-03 4:43 ` Christoph Hellwig
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=Zgz4YXUp+fFEN3qp@dread.disaster.area \
--to=david@fromorbit.com \
--cc=chandanbabu@kernel.org \
--cc=hch@infradead.org \
--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