All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxfs: disallow filesystems with reverse mapping and reflink and realtime
@ 2020-09-30 14:58 Darrick J. Wong
  2020-09-30 15:31 ` Eric Sandeen
  0 siblings, 1 reply; 3+ messages in thread
From: Darrick J. Wong @ 2020-09-30 14:58 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

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))

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

end of thread, other threads:[~2020-09-30 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 14:58 [PATCH] libxfs: disallow filesystems with reverse mapping and reflink and realtime Darrick J. Wong
2020-09-30 15:31 ` Eric Sandeen
2020-09-30 15:52   ` Darrick J. Wong

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.