diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-03-16 13:38:43 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-03-28 08:39:10 -0700 |
commit | 85bcfa26f9a3782be37d4feafd49668b98b8bdbe (patch) | |
tree | 13e476363f28b495b7c1b299b7c6b8031b7663eb /fs/xfs/xfs_fsops.c | |
parent | 82be38bcf8a2e056b4c99ce79a3827fa743df6ec (diff) | |
download | linux-85bcfa26f9a3782be37d4feafd49668b98b8bdbe.tar.gz linux-85bcfa26f9a3782be37d4feafd49668b98b8bdbe.tar.bz2 linux-85bcfa26f9a3782be37d4feafd49668b98b8bdbe.zip |
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>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r-- | fs/xfs/xfs_fsops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index 5b5b68affe66..196e2c51309c 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -347,7 +347,7 @@ xfs_fs_counts( cnt->allocino = percpu_counter_read_positive(&mp->m_icount); cnt->freeino = percpu_counter_read_positive(&mp->m_ifree); cnt->freedata = percpu_counter_read_positive(&mp->m_fdblocks) - - mp->m_alloc_set_aside; + xfs_fdblocks_unavailable(mp); spin_lock(&mp->m_sb_lock); cnt->freertx = mp->m_sb.sb_frextents; |