All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkfs: reject cowextsize after making final decision about reflink support
@ 2021-05-01  6:07 Darrick J. Wong
  2021-05-03 11:16 ` Brian Foster
  2021-05-04  8:57 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2021-05-01  6:07 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

From: Darrick J. Wong <djwong@kernel.org>

There's a snippet of code that rejects cowextsize option if reflink is
disabled.  This really ought to be /after/ the last place where we can
turn off reflink.  Fix it so that people don't see stuff like this:

$ mkfs.xfs -r rtdev=b.img a.img -f -d cowextsize=16
illegal CoW extent size hint 16, must be less than 9600.

(reflink isn't supported when realtime is enabled)

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 mkfs/xfs_mkfs.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 0eac5336..f84a42f9 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2164,13 +2164,6 @@ _("inode btree counters not supported without finobt support\n"));
 		cli->sb_feat.inobtcnt = false;
 	}
 
-	if ((cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE) &&
-	    !cli->sb_feat.reflink) {
-		fprintf(stderr,
-_("cowextsize not supported without reflink support\n"));
-		usage();
-	}
-
 	if (cli->xi->rtname) {
 		if (cli->sb_feat.reflink && cli_opt_set(&mopts, M_REFLINK)) {
 			fprintf(stderr,
@@ -2187,6 +2180,13 @@ _("rmapbt not supported with realtime devices\n"));
 		cli->sb_feat.rmapbt = false;
 	}
 
+	if ((cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE) &&
+	    !cli->sb_feat.reflink) {
+		fprintf(stderr,
+_("cowextsize not supported without reflink support\n"));
+		usage();
+	}
+
 	/*
 	 * Copy features across to config structure now.
 	 */

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

* Re: [PATCH] mkfs: reject cowextsize after making final decision about reflink support
  2021-05-01  6:07 [PATCH] mkfs: reject cowextsize after making final decision about reflink support Darrick J. Wong
@ 2021-05-03 11:16 ` Brian Foster
  2021-05-04  8:57 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2021-05-03 11:16 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, xfs

On Fri, Apr 30, 2021 at 11:07:45PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> There's a snippet of code that rejects cowextsize option if reflink is
> disabled.  This really ought to be /after/ the last place where we can
> turn off reflink.  Fix it so that people don't see stuff like this:
> 
> $ mkfs.xfs -r rtdev=b.img a.img -f -d cowextsize=16
> illegal CoW extent size hint 16, must be less than 9600.
> 
> (reflink isn't supported when realtime is enabled)
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  mkfs/xfs_mkfs.c |   14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
> index 0eac5336..f84a42f9 100644
> --- a/mkfs/xfs_mkfs.c
> +++ b/mkfs/xfs_mkfs.c
> @@ -2164,13 +2164,6 @@ _("inode btree counters not supported without finobt support\n"));
>  		cli->sb_feat.inobtcnt = false;
>  	}
>  
> -	if ((cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE) &&
> -	    !cli->sb_feat.reflink) {
> -		fprintf(stderr,
> -_("cowextsize not supported without reflink support\n"));
> -		usage();
> -	}
> -
>  	if (cli->xi->rtname) {
>  		if (cli->sb_feat.reflink && cli_opt_set(&mopts, M_REFLINK)) {
>  			fprintf(stderr,
> @@ -2187,6 +2180,13 @@ _("rmapbt not supported with realtime devices\n"));
>  		cli->sb_feat.rmapbt = false;
>  	}
>  
> +	if ((cli->fsx.fsx_xflags & FS_XFLAG_COWEXTSIZE) &&
> +	    !cli->sb_feat.reflink) {
> +		fprintf(stderr,
> +_("cowextsize not supported without reflink support\n"));
> +		usage();
> +	}
> +
>  	/*
>  	 * Copy features across to config structure now.
>  	 */
> 


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

* Re: [PATCH] mkfs: reject cowextsize after making final decision about reflink support
  2021-05-01  6:07 [PATCH] mkfs: reject cowextsize after making final decision about reflink support Darrick J. Wong
  2021-05-03 11:16 ` Brian Foster
@ 2021-05-04  8:57 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2021-05-04  8:57 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Eric Sandeen, xfs

On Fri, Apr 30, 2021 at 11:07:45PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> There's a snippet of code that rejects cowextsize option if reflink is
> disabled.  This really ought to be /after/ the last place where we can
> turn off reflink.  Fix it so that people don't see stuff like this:
> 
> $ mkfs.xfs -r rtdev=b.img a.img -f -d cowextsize=16
> illegal CoW extent size hint 16, must be less than 9600.
> 
> (reflink isn't supported when realtime is enabled)
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2021-05-04  8:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-01  6:07 [PATCH] mkfs: reject cowextsize after making final decision about reflink support Darrick J. Wong
2021-05-03 11:16 ` Brian Foster
2021-05-04  8:57 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.