Skip to contentSkip to conversation

zoned xfs updates

PATCH In review Christoph Hellwig 4 participants 16 messages May 27 – May 30 XFS filesystem

lore
Share & tools
lore
#0 lore raw

Hi Carlos,

this series has a fix for an hamrless issue in a recent commit, a cleanup, and then drops the experimental tag for the zoned allocator now that it has been in an upstream release for a year.

Diffstat:

 xfs_ioctl.c   |   47 +++++++++++++++++++++++++++--------------------
 xfs_message.c |    4 ----
 xfs_message.h |    1 -
 xfs_mount.h   |    2 --
 xfs_super.c   |    1 -
 5 files changed, 27 insertions(+), 28 deletions(-)
#1 lore raw

PATCH 1/3 xfs: drop the RTG reference later in xfs_ioc_rtgroup_geometry

Keep the rtgroup reference until after reporting the write pointer, as that uses it. Right now this is not a major issue as we don't support shrinking file systems in a way that makes RTGs go away, but let's stick to the proper reference counting to prepare for that.

Fixes c6ce65cb17aa ("xfs: add write pointer to xfs_rtgroup_geometry")
---
 fs/xfs/xfs_ioctl.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
fs/xfs/xfs_ioctl.c +5 -4
index 46e234863644..737afcb5652a 100644
@@ -433,9 +433,8 @@ xfs_ioc_rtgroup_geometry(
 		return -EINVAL;
 
 	error = xfs_rtgroup_get_geometry(rtg, &rgeo);
-	xfs_rtgroup_put(rtg);
 	if (error)
-		return error;
+		goto out_put_rtg;
 
 	if (xfs_has_zoned(mp)) {
 		xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
@@ -453,8 +452,10 @@ xfs_ioc_rtgroup_geometry(
 	}
 
 	if (copy_to_user(arg, &rgeo, sizeof(rgeo)))
-		return -EFAULT;
-	return 0;
+		error = -EFAULT;
+out_put_rtg:
+	xfs_rtgroup_put(rtg);
+	return error;
 }
 
 /*
Signature · 1 line
2.53.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] xfs: drop the RTG reference later in xfs_ioc_rtgroup_geometry

Quoted 7 lines · Christoph Hellwig

Keep the rtgroup reference until after reporting the write pointer, as that uses it. Right now this is not a major issue as we don't support shrinking file systems in a way that makes RTGs go away, but let's stick to the proper reference counting to prepare for that.

Fixes c6ce65cb17aa ("xfs: add write pointer to xfs_rtgroup_geometry")

Looks good to me.

Signature · 2 lines
Damien Le Moal
Western Digital Research
Reviewed-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] xfs: drop the RTG reference later in xfs_ioc_rtgroup_geometry

In reply to Christoph Hellwig
Quoted 8 lines · Christoph Hellwig

Keep the rtgroup reference until after reporting the write pointer, as
that uses it.  Right now this is not a major issue as we don't support
shrinking file systems in a way that makes RTGs go away, but let's stick
to the proper reference counting to prepare for that.

Quoted 5 lines
Fixes c6ce65cb17aa ("xfs: add write pointer to

xfs_rtgroup_geometry")

---

Cheers,
Wilfred

maintainer Reviewed-by on v1 1/3
#4 lore raw

Re: [PATCH 1/3] xfs: drop the RTG reference later in xfs_ioc_rtgroup_geometry

In reply to Christoph Hellwig
Quoted 7 lines · Christoph Hellwig

Keep the rtgroup reference until after reporting the write pointer, as that uses it. Right now this is not a major issue as we don't support shrinking file systems in a way that makes RTGs go away, but let's stick to the proper reference counting to prepare for that.

Fixes c6ce65cb17aa ("xfs: add write pointer to xfs_rtgroup_geometry")
Quoted 36 lines
---
 fs/xfs/xfs_ioctl.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
fs/xfs/xfs_ioctl.c +5 -4
index 46e234863644..737afcb5652a 100644
@@ -433,9 +433,8 @@ xfs_ioc_rtgroup_geometry(
 		return -EINVAL;
 
 	error = xfs_rtgroup_get_geometry(rtg, &rgeo);
-	xfs_rtgroup_put(rtg);
 	if (error)
-		return error;
+		goto out_put_rtg;
 
 	if (xfs_has_zoned(mp)) {
 		xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
@@ -453,8 +452,10 @@ xfs_ioc_rtgroup_geometry(
 	}
 
 	if (copy_to_user(arg, &rgeo, sizeof(rgeo)))
-		return -EFAULT;
-	return 0;
+		error = -EFAULT;
+out_put_rtg:
+	xfs_rtgroup_put(rtg);
+	return error;
 }
 
 /*
Signature · 1 line
2.53.0
#5 lore raw

PATCH 2/3 xfs: factor rtgroup geom write pointer reporting into a helper

In reply to Christoph Hellwig

Sticks out a bit better if we add a separate helper for it.

---
 fs/xfs/xfs_ioctl.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)
fs/xfs/xfs_ioctl.c +22 -16
index 737afcb5652a..96af6b62ce39 100644
@@ -409,6 +409,26 @@ xfs_ioc_ag_geometry(
 	return 0;
 }
 
+static void
+xfs_rtgroup_report_write_pointer(
+	struct xfs_rtgroup	*rtg,
+	struct xfs_rtgroup_geometry *rgeo)
+{
+	xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
+	if (rtg->rtg_open_zone) {
+		rgeo->rg_writepointer = rtg->rtg_open_zone->oz_allocated;
+	} else {
+		xfs_rgblock_t	highest_rgbno = xfs_rtrmap_highest_rgbno(rtg);
+
+		if (highest_rgbno == NULLRGBLOCK)
+			rgeo->rg_writepointer = 0;
+		else
+			rgeo->rg_writepointer = highest_rgbno + 1;
+	}
+	xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
+	rgeo->rg_flags |= XFS_RTGROUP_GEOM_WRITEPOINTER;
+}
+
 STATIC int
 xfs_ioc_rtgroup_geometry(
 	struct xfs_mount	*mp,
@@ -416,7 +436,6 @@ xfs_ioc_rtgroup_geometry(
 {
 	struct xfs_rtgroup	*rtg;
 	struct xfs_rtgroup_geometry rgeo;
-	xfs_rgblock_t		highest_rgbno;
 	int			error;
 
 	if (copy_from_user(&rgeo, arg, sizeof(rgeo)))
@@ -435,21 +454,8 @@ xfs_ioc_rtgroup_geometry(
 	error = xfs_rtgroup_get_geometry(rtg, &rgeo);
 	if (error)
 		goto out_put_rtg;
-
-	if (xfs_has_zoned(mp)) {
-		xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
-		if (rtg->rtg_open_zone) {
-			rgeo.rg_writepointer = rtg->rtg_open_zone->oz_allocated;
-		} else {
-			highest_rgbno = xfs_rtrmap_highest_rgbno(rtg);
-			if (highest_rgbno == NULLRGBLOCK)
-				rgeo.rg_writepointer = 0;
-			else
-				rgeo.rg_writepointer = highest_rgbno + 1;
-		}
-		xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
-		rgeo.rg_flags |= XFS_RTGROUP_GEOM_WRITEPOINTER;
-	}
+	if (xfs_has_zoned(mp))
+		xfs_rtgroup_report_write_pointer(rtg, &rgeo);
 
 	if (copy_to_user(arg, &rgeo, sizeof(rgeo)))
 		error = -EFAULT;
Signature · 1 line
2.53.0
maintainer Reviewed-by on v1 2/3
#8 lore raw

Re: [PATCH 2/3] xfs: factor rtgroup geom write pointer reporting into a helper

In reply to Christoph Hellwig
Quoted 3 lines · Christoph Hellwig

Sticks out a bit better if we add a separate helper for it.

Quoted 71 lines
---
 fs/xfs/xfs_ioctl.c | 38 ++++++++++++++++++++++----------------
 1 file changed, 22 insertions(+), 16 deletions(-)
fs/xfs/xfs_ioctl.c +22 -16
index 737afcb5652a..96af6b62ce39 100644
@@ -409,6 +409,26 @@ xfs_ioc_ag_geometry(
 	return 0;
 }
 
+static void
+xfs_rtgroup_report_write_pointer(
+	struct xfs_rtgroup	*rtg,
+	struct xfs_rtgroup_geometry *rgeo)
+{
+	xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
+	if (rtg->rtg_open_zone) {
+		rgeo->rg_writepointer = rtg->rtg_open_zone->oz_allocated;
+	} else {
+		xfs_rgblock_t	highest_rgbno = xfs_rtrmap_highest_rgbno(rtg);
+
+		if (highest_rgbno == NULLRGBLOCK)
+			rgeo->rg_writepointer = 0;
+		else
+			rgeo->rg_writepointer = highest_rgbno + 1;
+	}
+	xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
+	rgeo->rg_flags |= XFS_RTGROUP_GEOM_WRITEPOINTER;
+}
+
 STATIC int
 xfs_ioc_rtgroup_geometry(
 	struct xfs_mount	*mp,
@@ -416,7 +436,6 @@ xfs_ioc_rtgroup_geometry(
 {
 	struct xfs_rtgroup	*rtg;
 	struct xfs_rtgroup_geometry rgeo;
-	xfs_rgblock_t		highest_rgbno;
 	int			error;
 
 	if (copy_from_user(&rgeo, arg, sizeof(rgeo)))
@@ -435,21 +454,8 @@ xfs_ioc_rtgroup_geometry(
 	error = xfs_rtgroup_get_geometry(rtg, &rgeo);
 	if (error)
 		goto out_put_rtg;
-
-	if (xfs_has_zoned(mp)) {
-		xfs_rtgroup_lock(rtg, XFS_RTGLOCK_RMAP);
-		if (rtg->rtg_open_zone) {
-			rgeo.rg_writepointer = rtg->rtg_open_zone->oz_allocated;
-		} else {
-			highest_rgbno = xfs_rtrmap_highest_rgbno(rtg);
-			if (highest_rgbno == NULLRGBLOCK)
-				rgeo.rg_writepointer = 0;
-			else
-				rgeo.rg_writepointer = highest_rgbno + 1;
-		}
-		xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
-		rgeo.rg_flags |= XFS_RTGROUP_GEOM_WRITEPOINTER;
-	}
+	if (xfs_has_zoned(mp))
+		xfs_rtgroup_report_write_pointer(rtg, &rgeo);
 
 	if (copy_to_user(arg, &rgeo, sizeof(rgeo)))
 		error = -EFAULT;
Signature · 1 line
2.53.0
#9 lore raw

PATCH 3/3 xfs: drop the experimental warning for the zoned allocator

In reply to Christoph Hellwig

The zoned allocator has been released with 6.15 on May 25, 2025. It has seen constant maintenance and improvements and no major issues, so promote it out of the experimental category.

---
 fs/xfs/xfs_message.c | 4 ----
 fs/xfs/xfs_message.h | 1 -
 fs/xfs/xfs_mount.h   | 2 --
 fs/xfs/xfs_super.c   | 1 -
 4 files changed, 8 deletions(-)
fs/xfs/xfs_message.c +0 -4
index fd297082aeb8..0243e509a468 100644
@@ -149,10 +149,6 @@ xfs_warn_experimental(
 			.opstate	= XFS_OPSTATE_WARNED_LARP,
 			.name		= "logged extended attributes",
 		},
-		[XFS_EXPERIMENTAL_ZONED] = {
-			.opstate	= XFS_OPSTATE_WARNED_ZONED,
-			.name		= "zoned RT device",
-		},
 	};
 	ASSERT(feat >= 0 && feat < XFS_EXPERIMENTAL_MAX);
 	BUILD_BUG_ON(ARRAY_SIZE(features) != XFS_EXPERIMENTAL_MAX);
fs/xfs/xfs_message.h +0 -1
index 49b0ef40d299..811b885f41c3 100644
@@ -93,7 +93,6 @@ void xfs_buf_alert_ratelimited(struct xfs_buf *bp, const char *rlmsg,
 enum xfs_experimental_feat {
 	XFS_EXPERIMENTAL_SHRINK,
 	XFS_EXPERIMENTAL_LARP,
-	XFS_EXPERIMENTAL_ZONED,
 
 	XFS_EXPERIMENTAL_MAX,
 };
fs/xfs/xfs_mount.h +0 -2
index d964bae096ef..66a02d1b9ad7 100644
@@ -580,8 +580,6 @@ __XFS_HAS_FEAT(nouuid, NOUUID)
 #define XFS_OPSTATE_WARNED_METADIR	17
 /* Filesystem should use qflags to determine quotaon status */
 #define XFS_OPSTATE_RESUMING_QUOTAON	18
-/* Kernel has logged a warning about zoned RT device being used on this fs. */
-#define XFS_OPSTATE_WARNED_ZONED	19
 /* (Zoned) GC is in progress */
 #define XFS_OPSTATE_ZONEGC_RUNNING	20
 
fs/xfs/xfs_super.c +0 -1
index f8de44443e81..eac7f9503805 100644
@@ -1901,7 +1901,6 @@ xfs_fs_fill_super(
 			error = -EINVAL;
 			goto out_filestream_unmount;
 		}
-		xfs_warn_experimental(mp, XFS_EXPERIMENTAL_ZONED);
 	}
 
 	if (xfs_has_reflink(mp)) {
Signature · 1 line
2.53.0
Reviewed-by on v1 3/3
#10 lore raw

Re: [PATCH 3/3] xfs: drop the experimental warning for the zoned allocator

Quoted 5 lines · Christoph Hellwig

The zoned allocator has been released with 6.15 on May 25, 2025. It has seen constant maintenance and improvements and no major issues, so promote it out of the experimental category.

Yeah !

One nit below (feel free to ignore).

fs/xfs/xfs_mount.h __XFS_HAS_FEAT(nouuid, NOUUID) · line 584

Quoted 12 lines
fs/xfs/xfs_mount.h +0 -2
index d964bae096ef..66a02d1b9ad7 100644
@@ -580,8 +580,6 @@ __XFS_HAS_FEAT(nouuid, NOUUID)
 #define XFS_OPSTATE_WARNED_METADIR	17
 /* Filesystem should use qflags to determine quotaon status */
 #define XFS_OPSTATE_RESUMING_QUOTAON	18
-/* Kernel has logged a warning about zoned RT device being used on this fs. */
-#define XFS_OPSTATE_WARNED_ZONED	19
 /* (Zoned) GC is in progress */
 #define XFS_OPSTATE_ZONEGC_RUNNING	20

Do we want to compact the numbering and change this to 19 ?

Signature · 2 lines
Damien Le Moal
Western Digital Research
maintainer
#11 lore raw

Re: [PATCH 3/3] xfs: drop the experimental warning for the zoned allocator

Quoted 13 lines · Damien Le Moal
Quoted 5 lines · Christoph Hellwig

The zoned allocator has been released with 6.15 on May 25, 2025. It has seen constant maintenance and improvements and no major issues, so promote it out of the experimental category.

Yeah !

One nit below (feel free to ignore).

Quoted 14 lines

fs/xfs/xfs_mount.h __XFS_HAS_FEAT(nouuid, NOUUID) · line 584

Quoted 12 lines
fs/xfs/xfs_mount.h +0 -2
index d964bae096ef..66a02d1b9ad7 100644
@@ -580,8 +580,6 @@ __XFS_HAS_FEAT(nouuid, NOUUID)
 #define XFS_OPSTATE_WARNED_METADIR	17
 /* Filesystem should use qflags to determine quotaon status */
 #define XFS_OPSTATE_RESUMING_QUOTAON	18
-/* Kernel has logged a warning about zoned RT device being used on this fs. */
-#define XFS_OPSTATE_WARNED_ZONED	19
 /* (Zoned) GC is in progress */
 #define XFS_OPSTATE_ZONEGC_RUNNING	20

Do we want to compact the numbering and change this to 19 ?

I'd agree with Christoph and not reuse the warn number but perhaps I'm just being overly cautious as we don't have a 'stable' version which zoned support would be backported to :P

Quoted 6 lines
Signature · 3 lines
-- 
Damien Le Moal
Western Digital Research
#12 lore raw

Re: [PATCH 3/3] xfs: drop the experimental warning for the zoned allocator

Quoted 5 lines · Carlos Maiolino
Quoted 1 line

Do we want to compact the numbering and change this to 19 ?

I'd agree with Christoph and not reuse the warn number but perhaps I'm just being overly cautious as we don't have a 'stable' version which zoned support would be backported to :P

There's a lot of holes in this number space. I can send an incremental patch to compact it.

Reviewed-by on v1 3/3
#13 lore raw

Re: [PATCH 3/3] xfs: drop the experimental warning for the zoned allocator

In reply to Christoph Hellwig
Quoted 5 lines · Christoph Hellwig

The zoned allocator has been released with 6.15 on May 25, 2025.  It has
seen constant maintenance and improvements and no major issues, so promote it out of the experimental category.

Nice 🎉️!

Cheers,
Wilfred

maintainer Reviewed-by on v1 3/3
#14 lore raw

Re: [PATCH 3/3] xfs: drop the experimental warning for the zoned allocator

In reply to Christoph Hellwig
Quoted 5 lines · Christoph Hellwig

The zoned allocator has been released with 6.15 on May 25, 2025. It has seen constant maintenance and improvements and no major issues, so promote it out of the experimental category.

Agreed, I'll queue this one to 7.2 merge window.

Quoted 63 lines
---
 fs/xfs/xfs_message.c | 4 ----
 fs/xfs/xfs_message.h | 1 -
 fs/xfs/xfs_mount.h   | 2 --
 fs/xfs/xfs_super.c   | 1 -
 4 files changed, 8 deletions(-)
fs/xfs/xfs_message.c +0 -4
index fd297082aeb8..0243e509a468 100644
@@ -149,10 +149,6 @@ xfs_warn_experimental(
 			.opstate	= XFS_OPSTATE_WARNED_LARP,
 			.name		= "logged extended attributes",
 		},
-		[XFS_EXPERIMENTAL_ZONED] = {
-			.opstate	= XFS_OPSTATE_WARNED_ZONED,
-			.name		= "zoned RT device",
-		},
 	};
 	ASSERT(feat >= 0 && feat < XFS_EXPERIMENTAL_MAX);
 	BUILD_BUG_ON(ARRAY_SIZE(features) != XFS_EXPERIMENTAL_MAX);
fs/xfs/xfs_message.h +0 -1
index 49b0ef40d299..811b885f41c3 100644
@@ -93,7 +93,6 @@ void xfs_buf_alert_ratelimited(struct xfs_buf *bp, const char *rlmsg,
 enum xfs_experimental_feat {
 	XFS_EXPERIMENTAL_SHRINK,
 	XFS_EXPERIMENTAL_LARP,
-	XFS_EXPERIMENTAL_ZONED,
 
 	XFS_EXPERIMENTAL_MAX,
 };
fs/xfs/xfs_mount.h +0 -2
index d964bae096ef..66a02d1b9ad7 100644
@@ -580,8 +580,6 @@ __XFS_HAS_FEAT(nouuid, NOUUID)
 #define XFS_OPSTATE_WARNED_METADIR	17
 /* Filesystem should use qflags to determine quotaon status */
 #define XFS_OPSTATE_RESUMING_QUOTAON	18
-/* Kernel has logged a warning about zoned RT device being used on this fs. */
-#define XFS_OPSTATE_WARNED_ZONED	19
 /* (Zoned) GC is in progress */
 #define XFS_OPSTATE_ZONEGC_RUNNING	20
 
fs/xfs/xfs_super.c +0 -1
index f8de44443e81..eac7f9503805 100644
@@ -1901,7 +1901,6 @@ xfs_fs_fill_super(
 			error = -EINVAL;
 			goto out_filestream_unmount;
 		}
-		xfs_warn_experimental(mp, XFS_EXPERIMENTAL_ZONED);
 	}
 
 	if (xfs_has_reflink(mp)) {
Signature · 1 line
2.53.0
maintainer Applied
#15 lore raw
In reply to Christoph Hellwig
Quoted 5 lines · Christoph Hellwig

this series has a fix for an hamrless issue in a recent commit, a cleanup, and then drops the experimental tag for the zoned allocator now that it has been in an upstream release for a year.

Diffstat:

Quoted 8 lines
 xfs_ioctl.c   |   47 +++++++++++++++++++++++++++--------------------
 xfs_message.c |    4 ----
 xfs_message.h |    1 -
 xfs_mount.h   |    2 --
 xfs_super.c   |    1 -
 5 files changed, 27 insertions(+), 28 deletions(-)

[...]

Applied to for-next, thanks!

[1/3] xfs: drop the RTG reference later in xfs_ioc_rtgroup_geometry

      commit: c316bb56bf4dda9bd3456a163c3a3856ca1b9498
[2/3] xfs: factor rtgroup geom write pointer reporting into a helper
      commit: 2fa29c1a167739fdef0fda9742ddeb15d9a6c7e4

[3/3] xfs: drop the experimental warning for the zoned allocator
(no commit info)

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>