From: Dave Chinner <david@fromorbit.com>
To: linux-xfs@vger.kernel.org
Cc: chandanbabu@kernel.org
Subject: [PATCH 0/4] xfs: fixes for 6.9-rcX
Date: Wed, 3 Apr 2024 08:38:15 +1100 [thread overview]
Message-ID: <20240402221127.1200501-1-david@fromorbit.com> (raw)
Hi Chandan,
The following patches are fixes I consider necessary for the current
-rc cycle.
The first patch addresses a potential regression when allocating
temporary memory buffers for xattr block manipulations. It was found
during BS > PS development. While I don't think it can manifest on
existing kernels (because xattr block size is limited to page size),
it's better to fix it straight away so we don't leave a landmine
that will get stepped on sooner rather than later.
The second patch addresses a regression from the 6.6 kernels. It
removed ENOSPC detection from xfs_alloc_file_space() and replaced it
with an endless loop. This patch essentially reverts the commit
that caused the issue because it allows xfs_alloc_file_space() to
fall into an unkillable loop where it will endlessly retrying an
allocation that keeps failing. It will not making forwards progress,
and there is no way to break out of the loop. A reboot is needed to
fix the situation. This was found whilst triaging a bug that
corrupted free space accounting.
This was trying to address an issue with RT delalloc and the whacky
"delalloc does partial allocation but reports no allocation at all"
xfs_bmapi_write() semantics that was causing fallocate() to fail on
delalloc extents on RT devices. This was the wrong way to fix the
issue - we need to fix the whacky "partial progress was made but
tell the caller ENOSPC" behaviour so that callers can distinguish
between a hard ENOSPC error and a "keep allocating because we made
partial progress" condition.
The third addresses another problem found during triage of the same
free space accounting issue yesterday. A fchown() was run, leading
to a new dquot cluster being allocated. The transaction reservation
succeeded (because free space counter issues) and then the
allocation failed. This code does not handle allocation failure at
all - it has an ASSERT() that allocation succeeded - leading to it
trying to allocate a buffer over a disk address that was not
initialised and "access beyond EOFS" warnings from the buffer cache.
This patch handles the allocation failure in a manner that prevents
a shutdown from occurring and ensures -ENOSPC is returned to the
caller.
The last patch fixes the free space accounting issue that uncovered
the bugs fixes by the previous two patches. This can be triggered
from userspace, though it requires CAP_SYS_ADMIN and so requires
trust/privilege to be gained before it can be abused.
These have all passed through several fstests runs overnight without
introducing new regressions.
-Dave.
next reply other threads:[~2024-04-02 22:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 21:38 Dave Chinner [this message]
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
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=20240402221127.1200501-1-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=chandanbabu@kernel.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