All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Iliopoulos <ailiop@suse.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 3/6] mkfs: warn if reflink option is enabled on dax-capable devices
Date: Mon, 24 Aug 2020 22:37:21 +0200	[thread overview]
Message-ID: <20200824203724.13477-4-ailiop@suse.com> (raw)
In-Reply-To: <20200824203724.13477-1-ailiop@suse.com>

Reflink is currently not supported in conjunction with dax. Warn if this
config is enabled during mkfs to make it clear that the filesystem will
not be mountable with reflinks and dax enabled.

Make the option overridable so that incompatible fs configurations can
still be created, e.g. for testing or for cases where the filesystem is
not intended to be mounted with the dax option switched on.

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
---
 mkfs/xfs_mkfs.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 4fe0bbdcc40c..b8739c2b9093 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -1883,7 +1883,9 @@ _("log stripe unit specified, using v2 logs\n"));
 static void
 validate_sb_features(
 	struct mkfs_params	*cfg,
-	struct cli_params	*cli)
+	struct cli_params	*cli,
+	struct fs_topology	*ft,
+	int			force)
 {
 	/*
 	 * Now we have blocks and sector sizes set up, check parameters that are
@@ -2003,6 +2005,16 @@ _("rmapbt not supported with realtime devices\n"));
 		cli->sb_feat.rmapbt = false;
 	}
 
+	if (cli->sb_feat.reflink && ft->dax) {
+		fprintf(stderr, _("reflink not supported with dax devices\n"));
+
+		if (!force) {
+			fprintf(stderr,
+				_("Use -f to force enabling reflink\n"));
+			usage();
+		}
+	}
+
 	/*
 	 * Copy features across to config structure now.
 	 */
@@ -3714,7 +3726,7 @@ main(
 	sectorsize = cfg.sectorsize;
 
 	validate_log_sectorsize(&cfg, &cli, &dft);
-	validate_sb_features(&cfg, &cli);
+	validate_sb_features(&cfg, &cli, &ft, force_overwrite);
 
 	/*
 	 * we've now completed basic validation of the features, sector and
-- 
2.28.0


  parent reply	other threads:[~2020-08-24 20:37 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 20:37 [PATCH 0/6] xfsprogs: blockdev dax detection and warnings Anthony Iliopoulos
2020-08-24 20:37 ` [PATCH 1/6] libfrog: add dax capability detection in topology probing Anthony Iliopoulos
2020-08-24 20:37 ` [PATCH 2/6] mkfs: warn if blocksize doesn't match pagesize on dax devices Anthony Iliopoulos
2020-08-24 20:37 ` Anthony Iliopoulos [this message]
2020-08-24 20:37 ` [PATCH 4/6] mkfs: introduce -y option to force incompat config combinations Anthony Iliopoulos
2020-08-24 20:37 ` [PATCH 5/6] mkfs: remove redundant assignment of cli sb options on failure Anthony Iliopoulos
2020-09-28 21:49   ` Eric Sandeen
2020-09-28 21:56     ` Eric Sandeen
2020-08-24 20:37 ` [PATCH 6/6] mkfs: remove a couple of unused function parameters Anthony Iliopoulos
2020-09-28 21:50   ` Eric Sandeen
2020-08-24 22:55 ` [PATCH 0/6] xfsprogs: blockdev dax detection and warnings Dave Chinner
2020-08-25  8:48   ` Anthony Iliopoulos
2020-08-25 13:59   ` Eric Sandeen
2020-08-25 14:40     ` Darrick J. Wong
2020-08-25 22:31       ` Dave Chinner
2020-08-25 15:09     ` Anthony Iliopoulos
2020-08-25 17:32       ` Eric Sandeen

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=20200824203724.13477-4-ailiop@suse.com \
    --to=ailiop@suse.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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.