mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 18:40:10 +00:00
xfs: perag initialization should only touch m_ag_max_usable for AG 0
commit 9789dd9e1d upstream.
We call __xfs_ag_resv_init to make a per-AG reservation for each AG.
This makes the reservation per-AG, not per-filesystem. Therefore, it
is incorrect to adjust m_ag_max_usable for each AG. Adjust it only
when we're reserving AG 0's blocks so that we only do it once per fs.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8da6f7fbe4
commit
d0fa252b20
@@ -156,6 +156,7 @@ __xfs_ag_resv_free(
|
|||||||
trace_xfs_ag_resv_free(pag, type, 0);
|
trace_xfs_ag_resv_free(pag, type, 0);
|
||||||
|
|
||||||
resv = xfs_perag_resv(pag, type);
|
resv = xfs_perag_resv(pag, type);
|
||||||
|
if (pag->pag_agno == 0)
|
||||||
pag->pag_mount->m_ag_max_usable += resv->ar_asked;
|
pag->pag_mount->m_ag_max_usable += resv->ar_asked;
|
||||||
/*
|
/*
|
||||||
* AGFL blocks are always considered "free", so whatever
|
* AGFL blocks are always considered "free", so whatever
|
||||||
@@ -216,6 +217,13 @@ __xfs_ag_resv_init(
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Reduce the maximum per-AG allocation length by however much we're
|
||||||
|
* trying to reserve for an AG. Since this is a filesystem-wide
|
||||||
|
* counter, we only make the adjustment for AG 0. This assumes that
|
||||||
|
* there aren't any AGs hungrier for per-AG reservation than AG 0.
|
||||||
|
*/
|
||||||
|
if (pag->pag_agno == 0)
|
||||||
mp->m_ag_max_usable -= ask;
|
mp->m_ag_max_usable -= ask;
|
||||||
|
|
||||||
resv = xfs_perag_resv(pag, type);
|
resv = xfs_perag_resv(pag, type);
|
||||||
|
|||||||
Reference in New Issue
Block a user