On Tue, Aug 12, 2025 at 11:24:11PM -0700, Christoph Hellwig wrote: > On Tue, Aug 12, 2025 at 11:14:52PM -0700, Darrick J. Wong wrote: > > Yeah... for the other ENOSPC-on-write paths, we kick inodegc, so maybe > > xfs_zoned_space_reserve (or its caller, more likely) ought to do that > > too? > > Can you give this a spin? Still running testing here, but so far > nothing blew up. Running inodegc_flush() once doesn't fix it, but doesn't hurt either. --D > diff --git a/fs/xfs/xfs_zone_space_resv.c b/fs/xfs/xfs_zone_space_resv.c > index 1313c55b8cbe..9cd38716fd25 100644 > --- a/fs/xfs/xfs_zone_space_resv.c > +++ b/fs/xfs/xfs_zone_space_resv.c > @@ -10,6 +10,7 @@ > #include "xfs_mount.h" > #include "xfs_inode.h" > #include "xfs_rtbitmap.h" > +#include "xfs_icache.h" > #include "xfs_zone_alloc.h" > #include "xfs_zone_priv.h" > #include "xfs_zones.h" > @@ -230,6 +231,11 @@ xfs_zoned_space_reserve( > > error = xfs_dec_freecounter(mp, XC_FREE_RTEXTENTS, count_fsb, > flags & XFS_ZR_RESERVED); > + if (error == -ENOSPC && !(flags & XFS_ZR_NOWAIT)) { > + xfs_inodegc_flush(mp); > + error = xfs_dec_freecounter(mp, XC_FREE_RTEXTENTS, count_fsb, > + flags & XFS_ZR_RESERVED); > + } > if (error == -ENOSPC && (flags & XFS_ZR_GREEDY) && count_fsb > 1) > error = xfs_zoned_reserve_extents_greedy(mp, &count_fsb, flags); > if (error) >