Skip to content

Commit 5b9ff39

Browse files
committed
Merge tag 'xfs-6.3-fixes-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull yet more xfs bug fixes from Darrick Wong: "The first bugfix addresses a longstanding problem where we use the wrong file mapping cursors when trying to compute the speculative preallocation quantity. This has been causing sporadic crashes when alwayscow mode is engaged. The other two fixes correct minor problems in more recent changes. - Fix the new allocator tracepoints because git am mismerged the changes such that the trace_XXX got rebased to be in function YYY instead of XXX - Ensure that the perag AGFL_RESET state is consistent with whatever we've just read off the disk - Fix a bug where we used the wrong iext cursor during a write begin" * tag 'xfs-6.3-fixes-7' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: fix mismerged tracepoints xfs: clear incore AGFL_RESET state if it's not needed xfs: pass the correct cursor to xfs_iomap_prealloc_size
2 parents f768b35 + 4dfb02d commit 5b9ff39

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

fs/xfs/libxfs/xfs_alloc.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3045,6 +3045,8 @@ xfs_alloc_read_agf(
30453045
pag->pagf_refcount_level = be32_to_cpu(agf->agf_refcount_level);
30463046
if (xfs_agfl_needs_reset(pag->pag_mount, agf))
30473047
set_bit(XFS_AGSTATE_AGFL_NEEDS_RESET, &pag->pag_opstate);
3048+
else
3049+
clear_bit(XFS_AGSTATE_AGFL_NEEDS_RESET, &pag->pag_opstate);
30483050

30493051
/*
30503052
* Update the in-core allocbt counter. Filter out the rmapbt
@@ -3411,7 +3413,7 @@ xfs_alloc_vextent_start_ag(
34113413
args->agno = NULLAGNUMBER;
34123414
args->agbno = NULLAGBLOCK;
34133415

3414-
trace_xfs_alloc_vextent_first_ag(args);
3416+
trace_xfs_alloc_vextent_start_ag(args);
34153417

34163418
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
34173419
if (error) {
@@ -3464,7 +3466,7 @@ xfs_alloc_vextent_first_ag(
34643466
args->agno = NULLAGNUMBER;
34653467
args->agbno = NULLAGBLOCK;
34663468

3467-
trace_xfs_alloc_vextent_start_ag(args);
3469+
trace_xfs_alloc_vextent_first_ag(args);
34683470

34693471
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
34703472
if (error) {
@@ -3498,7 +3500,7 @@ xfs_alloc_vextent_exact_bno(
34983500
args->agno = XFS_FSB_TO_AGNO(mp, target);
34993501
args->agbno = XFS_FSB_TO_AGBNO(mp, target);
35003502

3501-
trace_xfs_alloc_vextent_near_bno(args);
3503+
trace_xfs_alloc_vextent_exact_bno(args);
35023504

35033505
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
35043506
if (error) {
@@ -3536,7 +3538,7 @@ xfs_alloc_vextent_near_bno(
35363538
args->agno = XFS_FSB_TO_AGNO(mp, target);
35373539
args->agbno = XFS_FSB_TO_AGBNO(mp, target);
35383540

3539-
trace_xfs_alloc_vextent_exact_bno(args);
3541+
trace_xfs_alloc_vextent_near_bno(args);
35403542

35413543
error = xfs_alloc_vextent_check_args(args, target, &minimum_agno);
35423544
if (error) {

fs/xfs/xfs_iomap.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1090,9 +1090,12 @@ xfs_buffered_write_iomap_begin(
10901090
*/
10911091
if (xfs_has_allocsize(mp))
10921092
prealloc_blocks = mp->m_allocsize_blocks;
1093-
else
1093+
else if (allocfork == XFS_DATA_FORK)
10941094
prealloc_blocks = xfs_iomap_prealloc_size(ip, allocfork,
10951095
offset, count, &icur);
1096+
else
1097+
prealloc_blocks = xfs_iomap_prealloc_size(ip, allocfork,
1098+
offset, count, &ccur);
10961099
if (prealloc_blocks) {
10971100
xfs_extlen_t align;
10981101
xfs_off_t end_offset;

0 commit comments

Comments
 (0)