From: Christoph Hellwig Date: Mon, 16 Dec 2024 07:14:42 +0000 (+0100) Subject: xfs: hide reserved RT blocks from statfs X-Git-Tag: v6.15-rc1~149^2~7^2~5^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55ef6e7a401fd748b5e879706b02083dc6eb0846;p=thirdparty%2Fkernel%2Flinux.git 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 Reviewed-by: "Darrick J. Wong" --- diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 39b2bad67fcde..b6426f5c8b51e 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_free[XC_FREE_RTEXTENTS].res_total); } static void