[PATCH] xfs: reset ag_max_usable when retrying failed per-ag reservation init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux