Skip to content

Commit bbe8502

Browse files
committed
Merge tag 'xfs-5.10-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull more xfs updates from Darrick Wong: "The second large pile of new stuff for 5.10, with changes even more monumental than last week! We are formally announcing the deprecation of the V4 filesystem format in 2030. All users must upgrade to the V5 format, which contains design improvements that greatly strengthen metadata validation, supports reflink and online fsck, and is the intended vehicle for handling timestamps past 2038. We're also deprecating the old Irix behavioral tweaks in September 2025. Coming along for the ride are two design changes to the deferred metadata ops subsystem. One of the improvements is to retain correct logical ordering of tasks and subtasks, which is a more logical design for upper layers of XFS and will become necessary when we add atomic file range swaps and commits. The second improvement to deferred ops improves the scalability of the log by helping the log tail to move forward during long-running operations. This reduces log contention when there are a large number of threads trying to run transactions. In addition to that, this fixes numerous small bugs in log recovery; refactors logical intent log item recovery to remove the last remaining place in XFS where we could have nested transactions; fixes a couple of ways that intent log item recovery could fail in ways that wouldn't have happened in the regular commit paths; fixes a deadlock vector in the GETFSMAP implementation (which improves its performance by 20%); and fixes serious bugs in the realtime growfs, fallocate, and bitmap handling code. Summary: - Deprecate the V4 filesystem format, some disused mount options, and some legacy sysctl knobs now that we can support dates into the 25th century. Note that removal of V4 support will not happen until the early 2030s. - Fix some probles with inode realtime flag propagation. - Fix some buffer handling issues when growing a rt filesystem. - Fix a problem where a BMAP_REMAP unmap call would free rt extents even though the purpose of BMAP_REMAP is to avoid freeing the blocks. - Strengthen the dabtree online scrubber to check hash values on child dabtree blocks. - Actually log new intent items created as part of recovering log intent items. - Fix a bug where quotas weren't attached to an inode undergoing bmap intent item recovery. - Fix a buffer overrun problem with specially crafted log buffer headers. - Various cleanups to type usage and slightly inaccurate comments. - More cleanups to the xattr, log, and quota code. - Don't run the (slower) shared-rmap operations on attr fork mappings. - Fix a bug where we failed to check the LSN of finobt blocks during replay and could therefore overwrite newer data with older data. - Clean up the ugly nested transaction mess that log recovery uses to stage intent item recovery in the correct order by creating a proper data structure to capture recovered chains. - Use the capture structure to resume intent item chains with the same log space and block reservations as when they were captured. - Fix a UAF bug in bmap intent item recovery where we failed to maintain our reference to the incore inode if the bmap operation needed to relog itself to continue. - Rearrange the defer ops mechanism to finish newly created subtasks of a parent task before moving on to the next parent task. - Automatically relog intent items in deferred ops chains if doing so would help us avoid pinning the log tail. This will help fix some log scaling problems now and will facilitate atomic file updates later. - Fix a deadlock in the GETFSMAP implementation by using an internal memory buffer to reduce indirect calls and copies to userspace, thereby improving its performance by ~20%. - Fix various problems when calling growfs on a realtime volume would not fully update the filesystem metadata. - Fix broken Kconfig asking about deprecated XFS when XFS is disabled" * tag 'xfs-5.10-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (48 commits) xfs: fix Kconfig asking about XFS_SUPPORT_V4 when XFS_FS=n xfs: fix high key handling in the rt allocator's query_range function xfs: annotate grabbing the realtime bitmap/summary locks in growfs xfs: make xfs_growfs_rt update secondary superblocks xfs: fix realtime bitmap/summary file truncation when growing rt volume xfs: fix the indent in xfs_trans_mod_dquot xfs: do the ASSERT for the arguments O_{u,g,p}dqpp xfs: fix deadlock and streamline xfs_getfsmap performance xfs: limit entries returned when counting fsmap records xfs: only relog deferred intent items if free space in the log gets low xfs: expose the log push threshold xfs: periodically relog deferred intent items xfs: change the order in which child and parent defer ops are finished xfs: fix an incore inode UAF in xfs_bui_recover xfs: clean up xfs_bui_item_recover iget/trans_alloc/ilock ordering xfs: clean up bmap intent item recovery checking xfs: xfs_defer_capture should absorb remaining transaction reservation xfs: xfs_defer_capture should absorb remaining block reservations xfs: proper replay of deferred ops queued during log recovery xfs: remove XFS_LI_RECOVERED ...
2 parents 6945653 + 8946455 commit bbe8502

37 files changed

+1023
-509
lines changed

Documentation/admin-guide/xfs.rst

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,38 @@ When mounting an XFS filesystem, the following options are accepted.
210210
inconsistent namespace presentation during or after a
211211
failover event.
212212

213+
Deprecation of V4 Format
214+
========================
215+
216+
The V4 filesystem format lacks certain features that are supported by
217+
the V5 format, such as metadata checksumming, strengthened metadata
218+
verification, and the ability to store timestamps past the year 2038.
219+
Because of this, the V4 format is deprecated. All users should upgrade
220+
by backing up their files, reformatting, and restoring from the backup.
221+
222+
Administrators and users can detect a V4 filesystem by running xfs_info
223+
against a filesystem mountpoint and checking for a string containing
224+
"crc=". If no such string is found, please upgrade xfsprogs to the
225+
latest version and try again.
226+
227+
The deprecation will take place in two parts. Support for mounting V4
228+
filesystems can now be disabled at kernel build time via Kconfig option.
229+
The option will default to yes until September 2025, at which time it
230+
will be changed to default to no. In September 2030, support will be
231+
removed from the codebase entirely.
232+
233+
Note: Distributors may choose to withdraw V4 format support earlier than
234+
the dates listed above.
213235

214236
Deprecated Mount Options
215237
========================
216238

217239
=========================== ================
218240
Name Removal Schedule
219241
=========================== ================
242+
Mounting with V4 filesystem September 2030
243+
ikeep/noikeep September 2025
244+
attr2/noattr2 September 2025
220245
=========================== ================
221246

222247

@@ -331,7 +356,12 @@ The following sysctls are available for the XFS filesystem:
331356
Deprecated Sysctls
332357
==================
333358

334-
None at present.
359+
=========================== ================
360+
Name Removal Schedule
361+
=========================== ================
362+
fs.xfs.irix_sgid_inherit September 2025
363+
fs.xfs.irix_symlink_mode September 2025
364+
=========================== ================
335365

336366

337367
Removed Sysctls

fs/xfs/Kconfig

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,31 @@ config XFS_FS
2222
system of your root partition is compiled as a module, you'll need
2323
to use an initial ramdisk (initrd) to boot.
2424

25+
config XFS_SUPPORT_V4
26+
bool "Support deprecated V4 (crc=0) format"
27+
depends on XFS_FS
28+
default y
29+
help
30+
The V4 filesystem format lacks certain features that are supported
31+
by the V5 format, such as metadata checksumming, strengthened
32+
metadata verification, and the ability to store timestamps past the
33+
year 2038. Because of this, the V4 format is deprecated. All users
34+
should upgrade by backing up their files, reformatting, and restoring
35+
from the backup.
36+
37+
Administrators and users can detect a V4 filesystem by running
38+
xfs_info against a filesystem mountpoint and checking for a string
39+
beginning with "crc=". If the string "crc=0" is found, the
40+
filesystem is a V4 filesystem. If no such string is found, please
41+
upgrade xfsprogs to the latest version and try again.
42+
43+
This option will become default N in September 2025. Support for the
44+
V4 format will be removed entirely in September 2030. Distributors
45+
can say N here to withdraw support earlier.
46+
47+
To continue supporting the old V4 format (crc=0), say Y.
48+
To close off an attack surface, say N.
49+
2550
config XFS_QUOTA
2651
bool "XFS Quota support"
2752
depends on XFS_FS

fs/xfs/libxfs/xfs_attr_remote.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ xfs_attr3_rmt_verify(
9696
{
9797
struct xfs_attr3_rmt_hdr *rmt = ptr;
9898

99-
if (!xfs_sb_version_hascrc(&mp->m_sb))
100-
return __this_address;
10199
if (!xfs_verify_magic(bp, rmt->rm_magic))
102100
return __this_address;
103101
if (!uuid_equal(&rmt->rm_uuid, &mp->m_sb.sb_meta_uuid))

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5046,20 +5046,25 @@ xfs_bmap_del_extent_real(
50465046

50475047
flags = XFS_ILOG_CORE;
50485048
if (whichfork == XFS_DATA_FORK && XFS_IS_REALTIME_INODE(ip)) {
5049-
xfs_fsblock_t bno;
50505049
xfs_filblks_t len;
50515050
xfs_extlen_t mod;
50525051

5053-
bno = div_u64_rem(del->br_startblock, mp->m_sb.sb_rextsize,
5054-
&mod);
5055-
ASSERT(mod == 0);
50565052
len = div_u64_rem(del->br_blockcount, mp->m_sb.sb_rextsize,
50575053
&mod);
50585054
ASSERT(mod == 0);
50595055

5060-
error = xfs_rtfree_extent(tp, bno, (xfs_extlen_t)len);
5061-
if (error)
5062-
goto done;
5056+
if (!(bflags & XFS_BMAPI_REMAP)) {
5057+
xfs_fsblock_t bno;
5058+
5059+
bno = div_u64_rem(del->br_startblock,
5060+
mp->m_sb.sb_rextsize, &mod);
5061+
ASSERT(mod == 0);
5062+
5063+
error = xfs_rtfree_extent(tp, bno, (xfs_extlen_t)len);
5064+
if (error)
5065+
goto done;
5066+
}
5067+
50635068
do_fx = 0;
50645069
nblks = len * mp->m_sb.sb_rextsize;
50655070
qfield = XFS_TRANS_DQ_RTBCOUNT;

fs/xfs/libxfs/xfs_da_format.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
#define XFS_DA_NODE_MAGIC 0xfebe /* magic number: non-leaf blocks */
1717
#define XFS_ATTR_LEAF_MAGIC 0xfbee /* magic number: attribute leaf blks */
18-
#define XFS_DIR2_LEAF1_MAGIC 0xd2f1 /* magic number: v2 dirlf single blks */
19-
#define XFS_DIR2_LEAFN_MAGIC 0xd2ff /* magic number: v2 dirlf multi blks */
18+
#define XFS_DIR2_LEAF1_MAGIC 0xd2f1 /* magic number: v2 dirlf single blks */
19+
#define XFS_DIR2_LEAFN_MAGIC 0xd2ff /* magic number: v2 dirlf multi blks */
2020

2121
typedef struct xfs_da_blkinfo {
2222
__be32 forw; /* previous block in list */
@@ -35,8 +35,8 @@ typedef struct xfs_da_blkinfo {
3535
*/
3636
#define XFS_DA3_NODE_MAGIC 0x3ebe /* magic number: non-leaf blocks */
3737
#define XFS_ATTR3_LEAF_MAGIC 0x3bee /* magic number: attribute leaf blks */
38-
#define XFS_DIR3_LEAF1_MAGIC 0x3df1 /* magic number: v2 dirlf single blks */
39-
#define XFS_DIR3_LEAFN_MAGIC 0x3dff /* magic number: v2 dirlf multi blks */
38+
#define XFS_DIR3_LEAF1_MAGIC 0x3df1 /* magic number: v3 dirlf single blks */
39+
#define XFS_DIR3_LEAFN_MAGIC 0x3dff /* magic number: v3 dirlf multi blks */
4040

4141
struct xfs_da3_blkinfo {
4242
/*
@@ -61,7 +61,7 @@ struct xfs_da3_blkinfo {
6161
* Since we have duplicate keys, use a binary search but always follow
6262
* all match in the block, not just the first match found.
6363
*/
64-
#define XFS_DA_NODE_MAXDEPTH 5 /* max depth of Btree */
64+
#define XFS_DA_NODE_MAXDEPTH 5 /* max depth of Btree */
6565

6666
typedef struct xfs_da_node_hdr {
6767
struct xfs_da_blkinfo info; /* block type, links, etc. */
@@ -746,14 +746,14 @@ xfs_attr3_leaf_name_local(xfs_attr_leafblock_t *leafp, int idx)
746746
*/
747747
static inline int xfs_attr_leaf_entsize_remote(int nlen)
748748
{
749-
return ((uint)sizeof(xfs_attr_leaf_name_remote_t) - 1 + (nlen) + \
750-
XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1);
749+
return round_up(sizeof(struct xfs_attr_leaf_name_remote) - 1 +
750+
nlen, XFS_ATTR_LEAF_NAME_ALIGN);
751751
}
752752

753753
static inline int xfs_attr_leaf_entsize_local(int nlen, int vlen)
754754
{
755-
return ((uint)sizeof(xfs_attr_leaf_name_local_t) - 1 + (nlen) + (vlen) +
756-
XFS_ATTR_LEAF_NAME_ALIGN - 1) & ~(XFS_ATTR_LEAF_NAME_ALIGN - 1);
755+
return round_up(sizeof(struct xfs_attr_leaf_name_local) - 1 +
756+
nlen + vlen, XFS_ATTR_LEAF_NAME_ALIGN);
757757
}
758758

759759
static inline int xfs_attr_leaf_entsize_local_max(int bsize)

0 commit comments

Comments
 (0)