diff options
| author | Christoph Hellwig <[email protected]> | 2025-08-18 05:06:44 +0000 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2025-08-19 12:37:07 +0000 |
| commit | 7d523255f524c95208cefef4edaed149615ff96c (patch) | |
| tree | 534320ceb59d0df5171b973227e9275bfff4db02 | |
| parent | xfs: remove xfs_last_used_zone (diff) | |
| download | kernel-7d523255f524c95208cefef4edaed149615ff96c.tar.gz kernel-7d523255f524c95208cefef4edaed149615ff96c.zip | |
xfs: kick off inodegc when failing to reserve zoned blocks
XFS processes truncating unlinked inodes asynchronously and thus the free
space pool only sees them with a delay. The non-zoned write path thus
calls into inodegc to accelerate this processing before failing an
allocation due the lack of free blocks. Do the same for the zoned space
reservation.
Fixes: 0bb2193056b5 ("xfs: add support for zoned space reservations")
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Hans Holmberg <[email protected]>
Signed-off-by: Carlos Maiolino <[email protected]>
| -rw-r--r-- | fs/xfs/xfs_zone_space_resv.c | 6 |
1 files changed, 6 insertions, 0 deletions
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) |
