public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] libxfs: disallow filesystems with reverse mapping and reflink and realtime
Date: Wed, 30 Sep 2020 07:58:40 -0700	[thread overview]
Message-ID: <20200930145840.GL49547@magnolia> (raw)

From: Darrick J. Wong <darrick.wong@oracle.com>

Neither the kernel nor the code in xfsprogs support filesystems that
have (either reverse mapping btrees or reflink) enabled and a realtime
volume configured.  The kernel rejects such combinations and mkfs
refuses to format such a config, but xfsprogs doesn't check and can do
Bad Things, so port those checks before someone shreds their filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libxfs/init.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/libxfs/init.c b/libxfs/init.c
index cb8967bc77d4..1a966084ffea 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -724,6 +724,20 @@ libxfs_mount(
 		exit(1);
 	}
 
+	if (xfs_sb_version_hasreflink(sbp) && sbp->sb_rblocks) {
+		fprintf(stderr,
+	_("%s: Reflink not compatible with realtime device. Please try a newer xfsprogs.\n"),
+				progname);
+		exit(1);
+	}
+
+	if (xfs_sb_version_hasrmapbt(sbp) && sbp->sb_rblocks) {
+		fprintf(stderr,
+	_("%s: Reverse mapping btree not compatible with realtime device. Please try a newer xfsprogs.\n"),
+				progname);
+		exit(1);
+	}
+
 	xfs_da_mount(mp);
 
 	if (xfs_sb_version_hasattr2(&mp->m_sb))

             reply	other threads:[~2020-09-30 14:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 14:58 Darrick J. Wong [this message]
2020-09-30 15:31 ` [PATCH] libxfs: disallow filesystems with reverse mapping and reflink and realtime Eric Sandeen
2020-09-30 15:52   ` Darrick J. Wong

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=20200930145840.GL49547@magnolia \
    --to=darrick.wong@oracle.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox