xfs: perag initialization should only touch m_ag_max_usable for AG 0
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 18 Sep 2017 16:42:09 +0000 (09:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Oct 2017 08:39:16 +0000 (10:39 +0200)
commitd0fa252b207fc7802e56e351874d94c25c484e1b
tree27cfca99db65bfe2f438ac6862deb536b4912bd1
parent8da6f7fbe43c1783d4fdf9af6d5457194e50a60d
xfs: perag initialization should only touch m_ag_max_usable for AG 0

commit 9789dd9e1d939232e8ff4c50ef8e75aa6781b3fb 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>
fs/xfs/libxfs/xfs_ag_resv.c