]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: fix fdblocks accounting w/ RMAPBT per-AG reservation
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 5 Jul 2018 20:16:04 +0000 (15:16 -0500)
commit2d49506d29376f579377368cd75031aa935a81d8
treee7d177a1f113b420bca1386d111ea895c036f1db
parenta4b61d98d4deef0c7cad6c0f349cf68935ee4055
xfs: fix fdblocks accounting w/ RMAPBT per-AG reservation

Source kernel commit: d8cb5e42378918e00eda58792f3ab86dd1e7d214

In __xfs_ag_resv_init we incorrectly calculate the amount by which to
decrease fdblocks when reserving blocks for the rmapbt.  Because rmapbt
allocations do not decrease fdblocks, we must decrease fdblocks by the
entire size of the requested reservation in order to achieve our goal of
always having enough free blocks to satisfy an rmapbt expansion.

This is in contrast to the refcountbt/finobt, which /do/ subtract from
fdblocks whenever they allocate a block.  For this allocation type we
preserve the existing behavior where we decrease fdblocks only by the
requested reservation minus the size of the existing tree.

This fixes the problem where the available block counts reported by
statfs change across a remount if there had been an rmapbt size change
since mount time.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_ag_resv.c