summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-08-06 11:05:42 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-08-09 10:52:18 -0700
commit01e8f379a4895a9a173391408db4fb49ec91e148 (patch)
treed52a1533c4aeb640eacc867556e247c1aa2b9fb3 /fs/xfs/xfs_super.c
parent2eb665027b6528c1a8e9158c2f722a6ec0af359d (diff)
downloadlinux-01e8f379a4895a9a173391408db4fb49ec91e148.tar.gz
linux-01e8f379a4895a9a173391408db4fb49ec91e148.tar.bz2
linux-01e8f379a4895a9a173391408db4fb49ec91e148.zip
xfs: flush inode inactivation work when compiling usage statistics
Users have come to expect that the space accounting information in statfs and getquota reports are fairly accurate. Now that we inactivate inodes from a background queue, these numbers can be thrown off by whatever resources are singly-owned by the inodes in the queue. Flush the pending inactivations when userspace asks for a space usage report. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index fd39b97c7bb4..d142aaaa50ef 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -785,6 +785,9 @@ xfs_fs_statfs(
xfs_extlen_t lsize;
int64_t ffree;
+ /* Wait for whatever inactivations are in progress. */
+ xfs_inodegc_flush(mp);
+
statp->f_type = XFS_SUPER_MAGIC;
statp->f_namelen = MAXNAMELEN - 1;