public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] xfs: Fix rgcount/rgsize value reported in XFS_IOC_FSGEOMETRY ioctl
@ 2025-12-08 15:16 Nirjhar Roy (IBM)
  2025-12-08 17:40 ` Darrick J. Wong
  0 siblings, 1 reply; 9+ messages in thread
From: Nirjhar Roy (IBM) @ 2025-12-08 15:16 UTC (permalink / raw)
  To: linux-xfs; +Cc: ritesh.list, ojaswin, djwong, hch, nirjhar.roy.lists

With mkfs.xfs -m dir=0 i.e, with XFS_SB_FEAT_INCOMPAT_METADIR
disabled, number of realtime groups should be reported as 1 and
the size of it should be equal to total number of realtime
extents since this the entire realtime filesystem has only 1
realtime group.

Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
 fs/xfs/libxfs/xfs_sb.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c
index cdd16dd805d7..989553e7ec02 100644
--- a/fs/xfs/libxfs/xfs_sb.c
+++ b/fs/xfs/libxfs/xfs_sb.c
@@ -875,7 +875,7 @@ __xfs_sb_from_disk(
 	} else {
 		to->sb_metadirino = NULLFSINO;
 		to->sb_rgcount = 1;
-		to->sb_rgextents = 0;
+		to->sb_rgextents = to->sb_rextents;
 	}
 
 	if (to->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_ZONED) {
@@ -1586,10 +1586,8 @@ xfs_fs_geometry(
 
 	geo->version = XFS_FSOP_GEOM_VERSION_V5;
 
-	if (xfs_has_rtgroups(mp)) {
-		geo->rgcount = sbp->sb_rgcount;
-		geo->rgextents = sbp->sb_rgextents;
-	}
+	geo->rgcount = sbp->sb_rgcount;
+	geo->rgextents = sbp->sb_rgextents;
 	if (xfs_has_zoned(mp)) {
 		geo->rtstart = sbp->sb_rtstart;
 		geo->rtreserved = sbp->sb_rtreserved;
-- 
2.43.5


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-12-17  5:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08 15:16 [PATCH v1] xfs: Fix rgcount/rgsize value reported in XFS_IOC_FSGEOMETRY ioctl Nirjhar Roy (IBM)
2025-12-08 17:40 ` Darrick J. Wong
2025-12-09  5:35   ` Nirjhar Roy (IBM)
2025-12-09  6:50     ` Darrick J. Wong
2025-12-09 10:23       ` Nirjhar Roy (IBM)
2025-12-09 15:59         ` Darrick J. Wong
2025-12-16  7:50           ` Nirjhar Roy (IBM)
2025-12-16 15:49             ` Darrick J. Wong
2025-12-17  5:42               ` Nirjhar Roy (IBM)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox