Skip to content

Commit 56c455b

Browse files
committed
Merge tag 'xfs-6.4-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs updates from Dave Chinner: "This consists mainly of online scrub functionality and the design documentation for the upcoming online repair functionality built on top of the scrub code: - Added detailed design documentation for the upcoming online repair feature - major update to online scrub to complete the reverse mapping cross-referencing infrastructure enabling us to fully validate allocated metadata against owner records. This is the last piece of scrub infrastructure needed before we can start merging online repair functionality. - Fixes for the ascii-ci hashing issues - deprecation of the ascii-ci functionality - on-disk format verification bug fixes - various random bug fixes for syzbot and other bug reports" * tag 'xfs-6.4-merge-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (107 commits) xfs: fix livelock in delayed allocation at ENOSPC xfs: Extend table marker on deprecated mount options table xfs: fix duplicate includes xfs: fix BUG_ON in xfs_getbmap() xfs: verify buffer contents when we skip log replay xfs: _{attr,data}_map_shared should take ILOCK_EXCL until iread_extents is completely done xfs: remove WARN when dquot cache insertion fails xfs: don't consider future format versions valid xfs: deprecate the ascii-ci feature xfs: test the ascii case-insensitive hash xfs: stabilize the dirent name transformation function used for ascii-ci dir hash computation xfs: cross-reference rmap records with refcount btrees xfs: cross-reference rmap records with inode btrees xfs: cross-reference rmap records with free space btrees xfs: cross-reference rmap records with ag btrees xfs: introduce bitmap type for AG blocks xfs: convert xbitmap to interval tree xfs: drop the _safe behavior from the xbitmap foreach macro xfs: don't load local xattr values during scrub xfs: remove the for_each_xbitmap_ helpers ...
2 parents bedf149 + 9419092 commit 56c455b

85 files changed

Lines changed: 10520 additions & 1890 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/admin-guide/xfs.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,13 +236,14 @@ the dates listed above.
236236
Deprecated Mount Options
237237
========================
238238

239-
=========================== ================
239+
============================ ================
240240
Name Removal Schedule
241-
=========================== ================
241+
============================ ================
242242
Mounting with V4 filesystem September 2030
243+
Mounting ascii-ci filesystem September 2030
243244
ikeep/noikeep September 2025
244245
attr2/noattr2 September 2025
245-
=========================== ================
246+
============================ ================
246247

247248

248249
Removed Mount Options

Documentation/filesystems/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,5 @@ Documentation for filesystem implementations.
123123
vfat
124124
xfs-delayed-logging-design
125125
xfs-self-describing-metadata
126+
xfs-online-fsck-design
126127
zonefs

Documentation/filesystems/xfs-online-fsck-design.rst

Lines changed: 5315 additions & 0 deletions
Large diffs are not rendered by default.

Documentation/filesystems/xfs-self-describing-metadata.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. SPDX-License-Identifier: GPL-2.0
2+
.. _xfs_self_describing_metadata:
23

34
============================
45
XFS Self Describing Metadata

fs/xfs/Kconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,33 @@ config XFS_SUPPORT_V4
4747
To continue supporting the old V4 format (crc=0), say Y.
4848
To close off an attack surface, say N.
4949

50+
config XFS_SUPPORT_ASCII_CI
51+
bool "Support deprecated case-insensitive ascii (ascii-ci=1) format"
52+
depends on XFS_FS
53+
default y
54+
help
55+
The ASCII case insensitivity filesystem feature only works correctly
56+
on systems that have been coerced into using ISO 8859-1, and it does
57+
not work on extended attributes. The kernel has no visibility into
58+
the locale settings in userspace, so it corrupts UTF-8 names.
59+
Enabling this feature makes XFS vulnerable to mixed case sensitivity
60+
attacks. Because of this, the feature is deprecated. All users
61+
should upgrade by backing up their files, reformatting, and restoring
62+
from the backup.
63+
64+
Administrators and users can detect such a filesystem by running
65+
xfs_info against a filesystem mountpoint and checking for a string
66+
beginning with "ascii-ci=". If the string "ascii-ci=1" is found, the
67+
filesystem is a case-insensitive filesystem. If no such string is
68+
found, please upgrade xfsprogs to the latest version and try again.
69+
70+
This option will become default N in September 2025. Support for the
71+
feature will be removed entirely in September 2030. Distributors
72+
can say N here to withdraw support earlier.
73+
74+
To continue supporting case-insensitivity (ascii-ci=1), say Y.
75+
To close off an attack surface, say N.
76+
5077
config XFS_QUOTA
5178
bool "XFS Quota support"
5279
depends on XFS_FS
@@ -93,10 +120,15 @@ config XFS_RT
93120

94121
If unsure, say N.
95122

123+
config XFS_DRAIN_INTENTS
124+
bool
125+
select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL
126+
96127
config XFS_ONLINE_SCRUB
97128
bool "XFS online metadata check support"
98129
default n
99130
depends on XFS_FS
131+
select XFS_DRAIN_INTENTS
100132
help
101133
If you say Y here you will be able to check metadata on a
102134
mounted XFS filesystem. This feature is intended to reduce

fs/xfs/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ ifeq ($(CONFIG_MEMORY_FAILURE),y)
136136
xfs-$(CONFIG_FS_DAX) += xfs_notify_failure.o
137137
endif
138138

139+
xfs-$(CONFIG_XFS_DRAIN_INTENTS) += xfs_drain.o
140+
139141
# online scrub/repair
140142
ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
141143

@@ -146,6 +148,7 @@ xfs-y += $(addprefix scrub/, \
146148
agheader.o \
147149
alloc.o \
148150
attr.o \
151+
bitmap.o \
149152
bmap.o \
150153
btree.o \
151154
common.o \
@@ -156,6 +159,7 @@ xfs-y += $(addprefix scrub/, \
156159
ialloc.o \
157160
inode.o \
158161
parent.o \
162+
readdir.o \
159163
refcount.o \
160164
rmap.o \
161165
scrub.o \
@@ -169,7 +173,6 @@ xfs-$(CONFIG_XFS_QUOTA) += scrub/quota.o
169173
ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y)
170174
xfs-y += $(addprefix scrub/, \
171175
agheader_repair.o \
172-
bitmap.o \
173176
repair.o \
174177
)
175178
endif

fs/xfs/libxfs/xfs_ag.c

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ xfs_perag_get_tag(
8181
return pag;
8282
}
8383

84+
/* Get a passive reference to the given perag. */
85+
struct xfs_perag *
86+
xfs_perag_hold(
87+
struct xfs_perag *pag)
88+
{
89+
ASSERT(atomic_read(&pag->pag_ref) > 0 ||
90+
atomic_read(&pag->pag_active_ref) > 0);
91+
92+
trace_xfs_perag_hold(pag, _RET_IP_);
93+
atomic_inc(&pag->pag_ref);
94+
return pag;
95+
}
96+
8497
void
8598
xfs_perag_put(
8699
struct xfs_perag *pag)
@@ -247,6 +260,7 @@ xfs_free_perag(
247260
spin_unlock(&mp->m_perag_lock);
248261
ASSERT(pag);
249262
XFS_IS_CORRUPT(pag->pag_mount, atomic_read(&pag->pag_ref) != 0);
263+
xfs_defer_drain_free(&pag->pag_intents_drain);
250264

251265
cancel_delayed_work_sync(&pag->pag_blockgc_work);
252266
xfs_buf_hash_destroy(pag);
@@ -372,6 +386,7 @@ xfs_initialize_perag(
372386
spin_lock_init(&pag->pag_state_lock);
373387
INIT_DELAYED_WORK(&pag->pag_blockgc_work, xfs_blockgc_worker);
374388
INIT_RADIX_TREE(&pag->pag_ici_root, GFP_ATOMIC);
389+
xfs_defer_drain_init(&pag->pag_intents_drain);
375390
init_waitqueue_head(&pag->pagb_wait);
376391
init_waitqueue_head(&pag->pag_active_wq);
377392
pag->pagb_count = 0;
@@ -408,6 +423,7 @@ xfs_initialize_perag(
408423
return 0;
409424

410425
out_remove_pag:
426+
xfs_defer_drain_free(&pag->pag_intents_drain);
411427
radix_tree_delete(&mp->m_perag_tree, index);
412428
out_free_pag:
413429
kmem_free(pag);
@@ -418,6 +434,7 @@ xfs_initialize_perag(
418434
if (!pag)
419435
break;
420436
xfs_buf_hash_destroy(pag);
437+
xfs_defer_drain_free(&pag->pag_intents_drain);
421438
kmem_free(pag);
422439
}
423440
return error;
@@ -1043,10 +1060,8 @@ xfs_ag_extend_space(
10431060
if (error)
10441061
return error;
10451062

1046-
error = xfs_free_extent(tp, XFS_AGB_TO_FSB(pag->pag_mount, pag->pag_agno,
1047-
be32_to_cpu(agf->agf_length) - len),
1048-
len, &XFS_RMAP_OINFO_SKIP_UPDATE,
1049-
XFS_AG_RESV_NONE);
1063+
error = xfs_free_extent(tp, pag, be32_to_cpu(agf->agf_length) - len,
1064+
len, &XFS_RMAP_OINFO_SKIP_UPDATE, XFS_AG_RESV_NONE);
10501065
if (error)
10511066
return error;
10521067

fs/xfs/libxfs/xfs_ag.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ struct xfs_perag {
101101
/* background prealloc block trimming */
102102
struct delayed_work pag_blockgc_work;
103103

104+
/*
105+
* We use xfs_drain to track the number of deferred log intent items
106+
* that have been queued (but not yet processed) so that waiters (e.g.
107+
* scrub) will not lock resources when other threads are in the middle
108+
* of processing a chain of intent items only to find momentary
109+
* inconsistencies.
110+
*/
111+
struct xfs_defer_drain pag_intents_drain;
104112
#endif /* __KERNEL__ */
105113
};
106114

@@ -134,6 +142,7 @@ void xfs_free_perag(struct xfs_mount *mp);
134142
struct xfs_perag *xfs_perag_get(struct xfs_mount *mp, xfs_agnumber_t agno);
135143
struct xfs_perag *xfs_perag_get_tag(struct xfs_mount *mp, xfs_agnumber_t agno,
136144
unsigned int tag);
145+
struct xfs_perag *xfs_perag_hold(struct xfs_perag *pag);
137146
void xfs_perag_put(struct xfs_perag *pag);
138147

139148
/* Active AG references */

0 commit comments

Comments
 (0)