It's possible for the per-AG reservation initialization to return ENOSPC when fdblocks says there isn't free space. This is a valid state for the reservation tracker since subsequent extent freeing activity will simply be captured by the reservation mechanism, but if we subsequently retry a failed initialization, we need to undo the changes we made to ag_max_usable prior to recreating the reservation. Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> --- fs/xfs/libxfs/xfs_ag_resv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/xfs/libxfs/xfs_ag_resv.c b/fs/xfs/libxfs/xfs_ag_resv.c index 4773c1e..1bdd091 100644 --- a/fs/xfs/libxfs/xfs_ag_resv.c +++ b/fs/xfs/libxfs/xfs_ag_resv.c @@ -202,6 +202,12 @@ __xfs_ag_resv_init( struct xfs_ag_resv *resv; int error; + /* + * We have to reset ag_max_usable prior to retrying a failed + * initialization with a smaller request. + */ + mp->m_ag_max_usable += resv->ar_asked; + resv = xfs_perag_resv(pag, type); if (used > ask) ask = used; -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html