[PATCH 0/2] xfs: discard every free extent in a whole-AG FITRIM

From: Daejun Park via B4 Relay

Date: Sun Oct 25 2026 - 21:55:03 EST


A whole-device fstrim walks each AG but the last by length. Two bugs
in that walk leave free extents undiscarded, while fstrim reports the
whole range as trimmed. Patch 2 depends on patch 1.

The new fstests case xfs/842, sent separately, fails without this
series and passes with it. ./check -g trim shows no regressions
(generic/038 and 500 were not run).

---
Daejun Park (2):
xfs: don't skip free extents in later batches of a whole-AG FITRIM
xfs: don't skip free extents of the longest length in a whole-AG FITRIM

fs/xfs/xfs_discard.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
---
base-commit: ec8f62cc109a3f596b3c65dc0f1011c209239051
change-id: 20261023-xfs-fitrim-skip-7ff1cf0364c5

Best regards,
--
Daejun Park <daejun7.park@xxxxxxxxxxx>