diff mbox series

[32/45] xfs_mkfs: default to rtinherit=1 for zoned file systems

Message ID 20250409075557.3535745-33-hch@lst.de (mailing list archive)
State New
Headers show
Series [01/45] xfs: generalize the freespace and reserved blocks handling | expand

Commit Message

Christoph Hellwig April 9, 2025, 7:55 a.m. UTC
Zone file systems are intended to use sequential write required zones
(or areas treated as such) for data, and the main data device only for
metadata.  rtinherit=1 is the way to achieve that, so enabled it by
default.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 mkfs/xfs_mkfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Darrick J. Wong April 9, 2025, 6:59 p.m. UTC | #1
On Wed, Apr 09, 2025 at 09:55:35AM +0200, Christoph Hellwig wrote:
> Zone file systems are intended to use sequential write required zones
> (or areas treated as such) for data, and the main data device only for
> metadata.  rtinherit=1 is the way to achieve that, so enabled it by
> default.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  mkfs/xfs_mkfs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 6b5eb9eb140a..7d4114e8a2ea 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -2957,6 +2957,13 @@ _("rt extent size not supported on realtime devices with zoned mode\n"));
>  			}
>  			cli->rtextsize = 0;
>  		}
> +
> +		/*
> +		 * Force the rtinherit flag on the root inode for zoned file
> +		 * systems as they use the data device only as a metadata
> +		 * container.
> +		 */
> +		cli->fsx.fsx_xflags |= FS_XFLAG_RTINHERIT;

If the caller specified -d rtinherit=0, this will override their choice.
Perhaps only do this if !cli_opt_set(&dopts, D_RTINHERIT) ?  I can
imagine people trying to combine a large SSD and a large SMR drive and
wanting to be able to store files on both devices.

--D

>  	} else {
>  		if (cli->rtstart) {
>  			fprintf(stderr,
> -- 
> 2.47.2
> 
>
Christoph Hellwig April 10, 2025, 6:45 a.m. UTC | #2
On Wed, Apr 09, 2025 at 11:59:21AM -0700, Darrick J. Wong wrote:
> > +		/*
> > +		 * Force the rtinherit flag on the root inode for zoned file
> > +		 * systems as they use the data device only as a metadata
> > +		 * container.
> > +		 */
> > +		cli->fsx.fsx_xflags |= FS_XFLAG_RTINHERIT;
> 
> If the caller specified -d rtinherit=0, this will override their choice.
> Perhaps only do this if !cli_opt_set(&dopts, D_RTINHERIT) ?  I can
> imagine people trying to combine a large SSD and a large SMR drive and
> wanting to be able to store files on both devices.

Sounds reasonable.
diff mbox series

Patch

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 6b5eb9eb140a..7d4114e8a2ea 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2957,6 +2957,13 @@  _("rt extent size not supported on realtime devices with zoned mode\n"));
 			}
 			cli->rtextsize = 0;
 		}
+
+		/*
+		 * Force the rtinherit flag on the root inode for zoned file
+		 * systems as they use the data device only as a metadata
+		 * container.
+		 */
+		cli->fsx.fsx_xflags |= FS_XFLAG_RTINHERIT;
 	} else {
 		if (cli->rtstart) {
 			fprintf(stderr,