]> git.ipfire.org Git - people/ms/linux.git/commit - fs/xfs/xfs_super.c
xfs: don't report reserved bnobt space as available
authorDarrick J. Wong <djwong@kernel.org>
Wed, 16 Mar 2022 20:38:43 +0000 (13:38 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 28 Mar 2022 15:39:10 +0000 (08:39 -0700)
commit85bcfa26f9a3782be37d4feafd49668b98b8bdbe
tree13e476363f28b495b7c1b299b7c6b8031b7663eb
parent82be38bcf8a2e056b4c99ce79a3827fa743df6ec
xfs: don't report reserved bnobt space as available

On a modern filesystem, we don't allow userspace to allocate blocks for
data storage from the per-AG space reservations, the user-controlled
reservation pool that prevents ENOSPC in the middle of internal
operations, or the internal per-AG set-aside that prevents unwanted
filesystem shutdowns due to ENOSPC during a bmap btree split.

Since we now consider freespace btree blocks as unavailable for
allocation for data storage, we shouldn't report those blocks via statfs
either.  This makes the numbers that we return via the statfs f_bavail
and f_bfree fields a more conservative estimate of actual free space.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/xfs_fsops.c
fs/xfs/xfs_super.c