Skip to content

Commit 119d1b8

Browse files
committed
Merge tag 'xfs-6.10-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs updates from Chandan Babu: "Online repair feature continues to be expanded. Also, we now support delayed allocation for realtime devices which have an extent size that is equal to filesystem's block size. New code: - Introduce Parent Pointer extended attribute for inodes - Bring back delalloc support for realtime devices which have an extent size that is equal to filesystem's block size - Improve performance of log incompat feature handling Online Repair: - Implement atomic file content exchanges i.e. exchange ranges of bytes between two files atomically - Create temporary files to repair file-based metadata. This uses atomic file content exchange facility to swap file fork mappings between the temporary file and the metadata inode - Allow callers of directory/xattr code to set an explicit owner number to be written into the header fields of any new blocks that are created. This is required to avoid walking every block of the new structure and modify their ownership during online repair - Repair more data structures: - Extended attributes - Inode unlinked state - Directories - Symbolic links - AGI's unlinked inode list - Parent pointers - Move Orphan files to lost and found directory - Fixes for Inode repair functionality - Introduce a new sub-AG FITRIM implementation to reduce the duration for which the AGF lock is held - Updates for the design documentation - Use Parent Pointers to assist in checking directories, parent pointers, extended attributes, and link counts Fixes: - Prevent userspace from reading invalid file data due to incorrect. updation of file size when performing a non-atomic clone operation - Minor fixes to online repair - Fix confusing return values from xfs_bmapi_write() - Fix an out of bounds access due to incorrect h_size during log recovery - Defer upgrading the extent counters in xfs_reflink_end_cow_extent() until we know we are going to modify the extent mapping - Remove racy access to if_bytes check in xfs_reflink_end_cow_extent() - Fix sparse warnings Cleanups: - Hold inode locks on all files involved in a rename until the completion of the operation. This is in preparation for the parent pointers patchset where parent pointers are applied in a separate chained update from the actual directory update - Compile out v4 support when disabled - Cleanup xfs_extent_busy_clear() - Remove unused flags and fields from struct xfs_da_args - Remove definitions of unused functions - Improve extended attribute validation - Add higher level directory operations helpers to remove duplication of code - Cleanup quota (un)reservation interfaces" * tag 'xfs-6.10-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (221 commits) xfs: simplify iext overflow checking and upgrade xfs: remove a racy if_bytes check in xfs_reflink_end_cow_extent xfs: upgrade the extent counters in xfs_reflink_end_cow_extent later xfs: xfs_quota_unreserve_blkres can't fail xfs: consolidate the xfs_quota_reserve_blkres definitions xfs: clean up buffer allocation in xlog_do_recovery_pass xfs: fix log recovery buffer allocation for the legacy h_size fixup xfs: widen flags argument to the xfs_iflags_* helpers xfs: minor cleanups of xfs_attr3_rmt_blocks xfs: create a helper to compute the blockcount of a max sized remote value xfs: turn XFS_ATTR3_RMT_BUF_SPACE into a function xfs: use unsigned ints for non-negative quantities in xfs_attr_remote.c xfs: do not allocate the entire delalloc extent in xfs_bmapi_write xfs: fix xfs_bmap_add_extent_delay_real for partial conversions xfs: remove the xfs_iext_peek_prev_extent call in xfs_bmapi_allocate xfs: pass the actual offset and len to allocate to xfs_bmapi_allocate xfs: don't open code XFS_FILBLKS_MIN in xfs_bmapi_write xfs: lift a xfs_valid_startblock into xfs_bmapi_allocate xfs: remove the unusued tmp_logflags variable in xfs_bmapi_allocate xfs: fix error returns from xfs_bmapi_write ...
2 parents bb6b206 + 25576c5 commit 119d1b8

File tree

186 files changed

+25085
-3025
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

+25085
-3025
lines changed

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

Lines changed: 416 additions & 220 deletions
Large diffs are not rendered by default.

fs/read_write.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,7 @@ int generic_write_check_limits(struct file *file, loff_t pos, loff_t *count)
16671667

16681668
return 0;
16691669
}
1670+
EXPORT_SYMBOL_GPL(generic_write_check_limits);
16701671

16711672
/* Like generic_write_checks(), but takes size of write instead of iter. */
16721673
int generic_write_checks_count(struct kiocb *iocb, loff_t *count)

fs/remap_range.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ static int generic_remap_checks(struct file *file_in, loff_t pos_in,
9999
return 0;
100100
}
101101

102-
static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
103-
bool write)
102+
int remap_verify_area(struct file *file, loff_t pos, loff_t len, bool write)
104103
{
105104
int mask = write ? MAY_WRITE : MAY_READ;
106105
loff_t tmp;
@@ -118,6 +117,7 @@ static int remap_verify_area(struct file *file, loff_t pos, loff_t len,
118117

119118
return fsnotify_file_area_perm(file, mask, &pos, len);
120119
}
120+
EXPORT_SYMBOL_GPL(remap_verify_area);
121121

122122
/*
123123
* Ensure that we don't remap a partial EOF block in the middle of something

fs/xfs/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ xfs-y += $(addprefix libxfs/, \
3434
xfs_dir2_node.o \
3535
xfs_dir2_sf.o \
3636
xfs_dquot_buf.o \
37+
xfs_exchmaps.o \
3738
xfs_ialloc.o \
3839
xfs_ialloc_btree.o \
3940
xfs_iext_tree.o \
4041
xfs_inode_fork.o \
4142
xfs_inode_buf.o \
4243
xfs_log_rlimit.o \
4344
xfs_ag_resv.o \
45+
xfs_parent.o \
4446
xfs_rmap.o \
4547
xfs_rmap_btree.o \
4648
xfs_refcount.o \
@@ -49,6 +51,7 @@ xfs-y += $(addprefix libxfs/, \
4951
xfs_symlink_remote.o \
5052
xfs_trans_inode.o \
5153
xfs_trans_resv.o \
54+
xfs_trans_space.o \
5255
xfs_types.o \
5356
)
5457
# xfs_rtbitmap is shared with libxfs
@@ -67,13 +70,15 @@ xfs-y += xfs_aops.o \
6770
xfs_dir2_readdir.o \
6871
xfs_discard.o \
6972
xfs_error.o \
73+
xfs_exchrange.o \
7074
xfs_export.o \
7175
xfs_extent_busy.o \
7276
xfs_file.o \
7377
xfs_filestream.o \
7478
xfs_fsmap.o \
7579
xfs_fsops.o \
7680
xfs_globals.o \
81+
xfs_handle.o \
7782
xfs_health.o \
7883
xfs_icache.o \
7984
xfs_ioctl.o \
@@ -101,6 +106,7 @@ xfs-y += xfs_log.o \
101106
xfs_buf_item.o \
102107
xfs_buf_item_recover.o \
103108
xfs_dquot_item_recover.o \
109+
xfs_exchmaps_item.o \
104110
xfs_extfree_item.o \
105111
xfs_attr_item.o \
106112
xfs_icreate_item.o \
@@ -157,11 +163,13 @@ xfs-y += $(addprefix scrub/, \
157163
common.o \
158164
dabtree.o \
159165
dir.o \
166+
dirtree.o \
160167
fscounters.o \
161168
health.o \
162169
ialloc.o \
163170
inode.o \
164171
iscan.o \
172+
listxattr.o \
165173
nlinks.o \
166174
parent.o \
167175
readdir.o \
@@ -170,6 +178,7 @@ xfs-y += $(addprefix scrub/, \
170178
scrub.o \
171179
symlink.o \
172180
xfarray.o \
181+
xfblob.o \
173182
xfile.o \
174183
)
175184

@@ -191,23 +200,32 @@ ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y)
191200
xfs-y += $(addprefix scrub/, \
192201
agheader_repair.o \
193202
alloc_repair.o \
203+
attr_repair.o \
194204
bmap_repair.o \
195205
cow_repair.o \
206+
dir_repair.o \
207+
dirtree_repair.o \
208+
findparent.o \
196209
fscounters_repair.o \
197210
ialloc_repair.o \
198211
inode_repair.o \
199212
newbt.o \
200213
nlinks_repair.o \
214+
orphanage.o \
215+
parent_repair.o \
201216
rcbag_btree.o \
202217
rcbag.o \
203218
reap.o \
204219
refcount_repair.o \
205220
repair.o \
206221
rmap_repair.o \
222+
symlink_repair.o \
223+
tempfile.o \
207224
)
208225

209226
xfs-$(CONFIG_XFS_RT) += $(addprefix scrub/, \
210227
rtbitmap_repair.o \
228+
rtsummary_repair.o \
211229
)
212230

213231
xfs-$(CONFIG_XFS_QUOTA) += $(addprefix scrub/, \

fs/xfs/libxfs/xfs_ag.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ xfs_initialize_perag_data(
194194
pag = xfs_perag_get(mp, index);
195195
error = xfs_alloc_read_agf(pag, NULL, 0, NULL);
196196
if (!error)
197-
error = xfs_ialloc_read_agi(pag, NULL, NULL);
197+
error = xfs_ialloc_read_agi(pag, NULL, 0, NULL);
198198
if (error) {
199199
xfs_perag_put(pag);
200200
return error;
@@ -931,7 +931,7 @@ xfs_ag_shrink_space(
931931
int error, err2;
932932

933933
ASSERT(pag->pag_agno == mp->m_sb.sb_agcount - 1);
934-
error = xfs_ialloc_read_agi(pag, *tpp, &agibp);
934+
error = xfs_ialloc_read_agi(pag, *tpp, 0, &agibp);
935935
if (error)
936936
return error;
937937

@@ -963,9 +963,7 @@ xfs_ag_shrink_space(
963963
* Disable perag reservations so it doesn't cause the allocation request
964964
* to fail. We'll reestablish reservation before we return.
965965
*/
966-
error = xfs_ag_resv_free(pag);
967-
if (error)
968-
return error;
966+
xfs_ag_resv_free(pag);
969967

970968
/* internal log shouldn't also show up in the free space btrees */
971969
error = xfs_alloc_vextent_exact_bno(&args,
@@ -1062,7 +1060,7 @@ xfs_ag_extend_space(
10621060

10631061
ASSERT(pag->pag_agno == pag->pag_mount->m_sb.sb_agcount - 1);
10641062

1065-
error = xfs_ialloc_read_agi(pag, tp, &bp);
1063+
error = xfs_ialloc_read_agi(pag, tp, 0, &bp);
10661064
if (error)
10671065
return error;
10681066

@@ -1119,7 +1117,7 @@ xfs_ag_get_geometry(
11191117
int error;
11201118

11211119
/* Lock the AG headers. */
1122-
error = xfs_ialloc_read_agi(pag, NULL, &agi_bp);
1120+
error = xfs_ialloc_read_agi(pag, NULL, 0, &agi_bp);
11231121
if (error)
11241122
return error;
11251123
error = xfs_alloc_read_agf(pag, NULL, 0, &agf_bp);

fs/xfs/libxfs/xfs_ag_resv.c

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,13 @@ xfs_ag_resv_needed(
126126
}
127127

128128
/* Clean out a reservation */
129-
static int
129+
static void
130130
__xfs_ag_resv_free(
131131
struct xfs_perag *pag,
132132
enum xfs_ag_resv_type type)
133133
{
134134
struct xfs_ag_resv *resv;
135135
xfs_extlen_t oldresv;
136-
int error;
137136

138137
trace_xfs_ag_resv_free(pag, type, 0);
139138

@@ -149,30 +148,19 @@ __xfs_ag_resv_free(
149148
oldresv = resv->ar_orig_reserved;
150149
else
151150
oldresv = resv->ar_reserved;
152-
error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true);
151+
xfs_add_fdblocks(pag->pag_mount, oldresv);
153152
resv->ar_reserved = 0;
154153
resv->ar_asked = 0;
155154
resv->ar_orig_reserved = 0;
156-
157-
if (error)
158-
trace_xfs_ag_resv_free_error(pag->pag_mount, pag->pag_agno,
159-
error, _RET_IP_);
160-
return error;
161155
}
162156

163157
/* Free a per-AG reservation. */
164-
int
158+
void
165159
xfs_ag_resv_free(
166160
struct xfs_perag *pag)
167161
{
168-
int error;
169-
int err2;
170-
171-
error = __xfs_ag_resv_free(pag, XFS_AG_RESV_RMAPBT);
172-
err2 = __xfs_ag_resv_free(pag, XFS_AG_RESV_METADATA);
173-
if (err2 && !error)
174-
error = err2;
175-
return error;
162+
__xfs_ag_resv_free(pag, XFS_AG_RESV_RMAPBT);
163+
__xfs_ag_resv_free(pag, XFS_AG_RESV_METADATA);
176164
}
177165

178166
static int
@@ -216,7 +204,7 @@ __xfs_ag_resv_init(
216204
if (XFS_TEST_ERROR(false, mp, XFS_ERRTAG_AG_RESV_FAIL))
217205
error = -ENOSPC;
218206
else
219-
error = xfs_mod_fdblocks(mp, -(int64_t)hidden_space, true);
207+
error = xfs_dec_fdblocks(mp, hidden_space, true);
220208
if (error) {
221209
trace_xfs_ag_resv_init_error(pag->pag_mount, pag->pag_agno,
222210
error, _RET_IP_);

fs/xfs/libxfs/xfs_ag_resv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#ifndef __XFS_AG_RESV_H__
77
#define __XFS_AG_RESV_H__
88

9-
int xfs_ag_resv_free(struct xfs_perag *pag);
9+
void xfs_ag_resv_free(struct xfs_perag *pag);
1010
int xfs_ag_resv_init(struct xfs_perag *pag, struct xfs_trans *tp);
1111

1212
bool xfs_ag_resv_critical(struct xfs_perag *pag, enum xfs_ag_resv_type type);

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ xfs_prealloc_blocks(
7979
}
8080

8181
/*
82-
* The number of blocks per AG that we withhold from xfs_mod_fdblocks to
82+
* The number of blocks per AG that we withhold from xfs_dec_fdblocks to
8383
* guarantee that we can refill the AGFL prior to allocating space in a nearly
8484
* full AG. Although the space described by the free space btrees, the
8585
* blocks used by the freesp btrees themselves, and the blocks owned by the
@@ -89,7 +89,7 @@ xfs_prealloc_blocks(
8989
* until the fs goes down, we subtract this many AG blocks from the incore
9090
* fdblocks to ensure user allocation does not overcommit the space the
9191
* filesystem needs for the AGFLs. The rmap btree uses a per-AG reservation to
92-
* withhold space from xfs_mod_fdblocks, so we do not account for that here.
92+
* withhold space from xfs_dec_fdblocks, so we do not account for that here.
9393
*/
9494
#define XFS_ALLOCBT_AGFL_RESERVE 4
9595

0 commit comments

Comments
 (0)