From 9fd47156b2d3f442cb81d8c1a2dda1597d6daa21 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 16 Dec 2024 08:14:42 +0100 Subject: [PATCH] xfs: hide reserved RT blocks from statfs File systems with a zoned RT device have a large number of reserved blocks that are required for garbage collection, and which can't be filled with user data. Exclude them from the available blocks reported through stat(v)fs. Signed-off-by: Christoph Hellwig --- fs/xfs/xfs_super.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 5c1e01e92814..34b0f5a80412 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -869,7 +869,8 @@ xfs_statfs_rt( { st->f_bfree = xfs_rtbxlen_to_blen(mp, xfs_sum_freecounter(mp, XC_FREE_RTEXTENTS)); - st->f_blocks = mp->m_sb.sb_rblocks; + st->f_blocks = mp->m_sb.sb_rblocks - + xfs_rtbxlen_to_blen(mp, mp->m_resblks[XC_FREE_RTEXTENTS].total); } static void -- 2.50.1