Skip to content

Commit 70f8c6f

Browse files
committed
Merge tag 'xfs-6.6-fixes-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fixes from Chandan Babu: - Fix calculation of offset of AG's last block and its length - Update incore AG block count when shrinking an AG - Process free extents to busy list in FIFO order - Make XFS report its i_version as the STATX_CHANGE_COOKIE * tag 'xfs-6.6-fixes-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: xfs: reinstate the old i_version counter as STATX_CHANGE_COOKIE xfs: Remove duplicate include xfs: correct calculation for agend and blockcount xfs: process free extents to busy list in FIFO order xfs: adjust the incore perag block_count when shrinking
2 parents 727fb83 + cbc0631 commit 70f8c6f

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

fs/xfs/libxfs/xfs_ag.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,12 @@ xfs_ag_shrink_space(
10011001
error = -ENOSPC;
10021002
goto resv_init_out;
10031003
}
1004+
1005+
/* Update perag geometry */
1006+
pag->block_count -= delta;
1007+
__xfs_agino_range(pag->pag_mount, pag->block_count, &pag->agino_min,
1008+
&pag->agino_max);
1009+
10041010
xfs_ialloc_log_agi(*tpp, agibp, XFS_AGI_LENGTH);
10051011
xfs_alloc_log_agf(*tpp, agfbp, XFS_AGF_LENGTH);
10061012
return 0;

fs/xfs/scrub/xfile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "xfs_log_format.h"
1111
#include "xfs_trans_resv.h"
1212
#include "xfs_mount.h"
13-
#include "xfs_format.h"
1413
#include "scrub/xfile.h"
1514
#include "scrub/xfarray.h"
1615
#include "scrub/scrub.h"

fs/xfs/xfs_extent_busy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ xfs_extent_busy_insert_list(
6262
rb_link_node(&new->rb_node, parent, rbp);
6363
rb_insert_color(&new->rb_node, &pag->pagb_tree);
6464

65-
list_add(&new->list, busy_list);
65+
/* always process discard lists in fifo order */
66+
list_add_tail(&new->list, busy_list);
6667
spin_unlock(&pag->pagb_lock);
6768
}
6869

fs/xfs/xfs_iops.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ xfs_vn_getattr(
584584
}
585585
}
586586

587+
if ((request_mask & STATX_CHANGE_COOKIE) && IS_I_VERSION(inode)) {
588+
stat->change_cookie = inode_query_iversion(inode);
589+
stat->result_mask |= STATX_CHANGE_COOKIE;
590+
}
591+
587592
/*
588593
* Note: If you add another clause to set an attribute flag, please
589594
* update attributes_mask below.

fs/xfs/xfs_notify_failure.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ xfs_dax_notify_ddev_failure(
126126
struct xfs_rmap_irec ri_low = { };
127127
struct xfs_rmap_irec ri_high;
128128
struct xfs_agf *agf;
129-
xfs_agblock_t agend;
130129
struct xfs_perag *pag;
130+
xfs_agblock_t range_agend;
131131

132132
pag = xfs_perag_get(mp, agno);
133133
error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp);
@@ -148,10 +148,10 @@ xfs_dax_notify_ddev_failure(
148148
ri_high.rm_startblock = XFS_FSB_TO_AGBNO(mp, end_fsbno);
149149

150150
agf = agf_bp->b_addr;
151-
agend = min(be32_to_cpu(agf->agf_length),
151+
range_agend = min(be32_to_cpu(agf->agf_length) - 1,
152152
ri_high.rm_startblock);
153153
notify.startblock = ri_low.rm_startblock;
154-
notify.blockcount = agend - ri_low.rm_startblock;
154+
notify.blockcount = range_agend + 1 - ri_low.rm_startblock;
155155

156156
error = xfs_rmap_query_range(cur, &ri_low, &ri_high,
157157
xfs_dax_failure_fn, &notify);

0 commit comments

Comments
 (0)