Skip to contentSkip to conversation

mkfs: reject cowextsize after making final decision about reflink support

PATCH In review Darrick J. Wong 3 participants 3 messages May 1, 2021 – May 4, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs: reject cowextsize after making final decision about reflink support

From: Darrick J. Wong <[email protected]>

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)

---
 mkfs/xfs_mkfs.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
mkfs/xfs_mkfs.c +7 -7
index 0eac5336..f84a42f9 100644
@@ -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.
 	 */
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

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:

Quoted 7 lines
$ 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)

---

Quoted 36 lines
 mkfs/xfs_mkfs.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
mkfs/xfs_mkfs.c +7 -7
index 0eac5336..f84a42f9 100644
@@ -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.
 	 */
Reviewed-by on v1 1/1
#2 lore raw
In reply to Darrick J. Wong
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

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:

Quoted 6 lines
$ 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)

Looks good,