All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] mkfs: reject cowextsize after making final decision about reflink support
Date: Fri, 30 Apr 2021 23:07:45 -0700	[thread overview]
Message-ID: <20210501060745.GA7448@magnolia> (raw)

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.
 	 */

             reply	other threads:[~2021-05-01  6:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01  6:07 Darrick J. Wong [this message]
2021-05-03 11:16 ` [PATCH] mkfs: reject cowextsize after making final decision about reflink support Brian Foster
2021-05-04  8:57 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210501060745.GA7448@magnolia \
    --to=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.