Skip to content

Commit babbcc0

Browse files
committed
Merge tag 'xfs-6.9-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs updates from Chandan Babu: - Online repair updates: - More ondisk structures being repaired: - Inode's mode field by trying to obtain file type value from the a directory entry - Quota counters - Link counts of inodes - FS summary counters - Support for in-memory btrees has been added to support repair of rmap btrees - Misc changes: - Report corruption of metadata to the health tracking subsystem - Enable indirect health reporting when resources are scarce - Reduce memory usage while repairing refcount btree - Extend "Bmap update" intent item to support atomic extent swapping on the realtime device - Extend "Bmap update" intent item to support extended attribute fork and unwritten extents - Code cleanups: - Bmap log intent - Btree block pointer checking - Btree readahead - Buffer target - Symbolic link code - Remove mrlock wrapper around the rwsem - Convert all the GFP_NOFS flag usages to use the scoped memalloc_nofs_save() API instead of direct calls with the GFP_NOFS - Refactor and simplify xfile abstraction. Lower level APIs in shmem.c are required to be exported in order to achieve this - Skip checking alignment constraints for inode chunk allocations when block size is larger than inode chunk size - Do not submit delwri buffers collected during log recovery when an error has been encountered - Fix SEEK_HOLE/DATA for file regions which have active COW extents - Fix lock order inversion when executing error handling path during shrinking a filesystem - Remove duplicate ifdefs * tag 'xfs-6.9-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (183 commits) xfs: shrink failure needs to hold AGI buffer mm/shmem.c: Use new form of *@param in kernel-doc kernel-doc: Add unary operator * to $type_param_ref xfs: use kvfree() in xlog_cil_free_logvec() xfs: xfs_btree_bload_prep_block() should use __GFP_NOFAIL xfs: fix scrub stats file permissions xfs: fix log recovery erroring out on refcount recovery failure xfs: move symlink target write function to libxfs xfs: move remote symlink target read function to libxfs xfs: move xfs_symlink_remote.c declarations to xfs_symlink_remote.h xfs: xfs_bmap_finish_one should map unwritten extents properly xfs: support deferred bmap updates on the attr fork xfs: support recovering bmap intent items targetting realtime extents xfs: add a realtime flag to the bmap update log redo items xfs: add a xattr_entry helper xfs: fix xfs_bunmapi to allow unmapping of partial rt extents xfs: move xfs_bmap_defer_add to xfs_bmap_item.c xfs: reuse xfs_bmap_update_cancel_item xfs: add a bi_entry helper xfs: remove xfs_trans_set_bmap_flags ...
2 parents 279d44c + 75bcffb commit babbcc0

File tree

186 files changed

+13251
-3562
lines changed

Some content is hidden

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

186 files changed

+13251
-3562
lines changed

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

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,19 +1915,13 @@ four of those five higher level data structures.
19151915
The fifth use case is discussed in the :ref:`realtime summary <rtsummary>` case
19161916
study.
19171917

1918-
The most general storage interface supported by the xfile enables the reading
1919-
and writing of arbitrary quantities of data at arbitrary offsets in the xfile.
1920-
This capability is provided by ``xfile_pread`` and ``xfile_pwrite`` functions,
1921-
which behave similarly to their userspace counterparts.
19221918
XFS is very record-based, which suggests that the ability to load and store
19231919
complete records is important.
1924-
To support these cases, a pair of ``xfile_obj_load`` and ``xfile_obj_store``
1925-
functions are provided to read and persist objects into an xfile.
1926-
They are internally the same as pread and pwrite, except that they treat any
1927-
error as an out of memory error.
1928-
For online repair, squashing error conditions in this manner is an acceptable
1929-
behavior because the only reaction is to abort the operation back to userspace.
1930-
All five xfile usecases can be serviced by these four functions.
1920+
To support these cases, a pair of ``xfile_load`` and ``xfile_store``
1921+
functions are provided to read and persist objects into an xfile that treat any
1922+
error as an out of memory error. For online repair, squashing error conditions
1923+
in this manner is an acceptable behavior because the only reaction is to abort
1924+
the operation back to userspace.
19311925

19321926
However, no discussion of file access idioms is complete without answering the
19331927
question, "But what about mmap?"
@@ -1939,15 +1933,14 @@ tmpfs can only push a pagecache folio to the swap cache if the folio is neither
19391933
pinned nor locked, which means the xfile must not pin too many folios.
19401934

19411935
Short term direct access to xfile contents is done by locking the pagecache
1942-
folio and mapping it into kernel address space.
1943-
Programmatic access (e.g. pread and pwrite) uses this mechanism.
1944-
Folio locks are not supposed to be held for long periods of time, so long
1945-
term direct access to xfile contents is done by bumping the folio refcount,
1936+
folio and mapping it into kernel address space. Object load and store uses this
1937+
mechanism. Folio locks are not supposed to be held for long periods of time, so
1938+
long term direct access to xfile contents is done by bumping the folio refcount,
19461939
mapping it into kernel address space, and dropping the folio lock.
19471940
These long term users *must* be responsive to memory reclaim by hooking into
19481941
the shrinker infrastructure to know when to release folios.
19491942

1950-
The ``xfile_get_page`` and ``xfile_put_page`` functions are provided to
1943+
The ``xfile_get_folio`` and ``xfile_put_folio`` functions are provided to
19511944
retrieve the (locked) folio that backs part of an xfile and to release it.
19521945
The only code to use these folio lease functions are the xfarray
19531946
:ref:`sorting<xfarray_sort>` algorithms and the :ref:`in-memory
@@ -2277,13 +2270,12 @@ follows:
22772270
pointing to the xfile.
22782271

22792272
3. Pass the buffer cache target, buffer ops, and other information to
2280-
``xfbtree_create`` to write an initial tree header and root block to the
2281-
xfile.
2273+
``xfbtree_init`` to initialize the passed in ``struct xfbtree`` and write an
2274+
initial root block to the xfile.
22822275
Each btree type should define a wrapper that passes necessary arguments to
22832276
the creation function.
22842277
For example, rmap btrees define ``xfs_rmapbt_mem_create`` to take care of
22852278
all the necessary details for callers.
2286-
A ``struct xfbtree`` object will be returned.
22872279

22882280
4. Pass the xfbtree object to the btree cursor creation function for the
22892281
btree type.

fs/xfs/Kconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,24 @@ config XFS_DRAIN_INTENTS
124124
bool
125125
select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL
126126

127+
config XFS_LIVE_HOOKS
128+
bool
129+
select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL
130+
131+
config XFS_MEMORY_BUFS
132+
bool
133+
134+
config XFS_BTREE_IN_MEM
135+
bool
136+
127137
config XFS_ONLINE_SCRUB
128138
bool "XFS online metadata check support"
129139
default n
130140
depends on XFS_FS
131141
depends on TMPFS && SHMEM
142+
select XFS_LIVE_HOOKS
132143
select XFS_DRAIN_INTENTS
144+
select XFS_MEMORY_BUFS
133145
help
134146
If you say Y here you will be able to check metadata on a
135147
mounted XFS filesystem. This feature is intended to reduce
@@ -164,6 +176,7 @@ config XFS_ONLINE_REPAIR
164176
bool "XFS online metadata repair support"
165177
default n
166178
depends on XFS_FS && XFS_ONLINE_SCRUB
179+
select XFS_BTREE_IN_MEM
167180
help
168181
If you say Y here you will be able to repair metadata on a
169182
mounted XFS filesystem. This feature is intended to reduce

fs/xfs/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ xfs-y += xfs_aops.o \
9292
xfs_symlink.o \
9393
xfs_sysfs.o \
9494
xfs_trans.o \
95-
xfs_xattr.o \
96-
kmem.o
95+
xfs_xattr.o
9796

9897
# low-level transaction/log code
9998
xfs-y += xfs_log.o \
@@ -137,6 +136,9 @@ xfs-$(CONFIG_FS_DAX) += xfs_notify_failure.o
137136
endif
138137

139138
xfs-$(CONFIG_XFS_DRAIN_INTENTS) += xfs_drain.o
139+
xfs-$(CONFIG_XFS_LIVE_HOOKS) += xfs_hooks.o
140+
xfs-$(CONFIG_XFS_MEMORY_BUFS) += xfs_buf_mem.o
141+
xfs-$(CONFIG_XFS_BTREE_IN_MEM) += libxfs/xfs_btree_mem.o
140142

141143
# online scrub/repair
142144
ifeq ($(CONFIG_XFS_ONLINE_SCRUB),y)
@@ -159,6 +161,8 @@ xfs-y += $(addprefix scrub/, \
159161
health.o \
160162
ialloc.o \
161163
inode.o \
164+
iscan.o \
165+
nlinks.o \
162166
parent.o \
163167
readdir.o \
164168
refcount.o \
@@ -179,6 +183,7 @@ xfs-$(CONFIG_XFS_RT) += $(addprefix scrub/, \
179183
xfs-$(CONFIG_XFS_QUOTA) += $(addprefix scrub/, \
180184
dqiterate.o \
181185
quota.o \
186+
quotacheck.o \
182187
)
183188

184189
# online repair
@@ -188,12 +193,17 @@ xfs-y += $(addprefix scrub/, \
188193
alloc_repair.o \
189194
bmap_repair.o \
190195
cow_repair.o \
196+
fscounters_repair.o \
191197
ialloc_repair.o \
192198
inode_repair.o \
193199
newbt.o \
200+
nlinks_repair.o \
201+
rcbag_btree.o \
202+
rcbag.o \
194203
reap.o \
195204
refcount_repair.o \
196205
repair.o \
206+
rmap_repair.o \
197207
)
198208

199209
xfs-$(CONFIG_XFS_RT) += $(addprefix scrub/, \
@@ -202,6 +212,7 @@ xfs-$(CONFIG_XFS_RT) += $(addprefix scrub/, \
202212

203213
xfs-$(CONFIG_XFS_QUOTA) += $(addprefix scrub/, \
204214
quota_repair.o \
215+
quotacheck_repair.o \
205216
)
206217
endif
207218
endif

fs/xfs/kmem.c

Lines changed: 0 additions & 30 deletions
This file was deleted.

fs/xfs/kmem.h

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)