diff mbox series

[01/16] fuse2fs: refuse unsupported features

Message ID 174553064943.1160461.14810321477577468832.stgit@frogsfrogsfrogs
State New
Headers show
Series [01/16] fuse2fs: refuse unsupported features | expand

Commit Message

Darrick J. Wong April 24, 2025, 9:41 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Don't mount a filesystem with superblock features that we don't actually
know how to support.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 misc/fuse2fs.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index f974171d3e726d..5a92e54031a8b7 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -3902,6 +3902,26 @@  int main(int argc, char *argv[])
 
 	ret = 3;
 
+	if (ext2fs_has_feature_quota(global_fs->super)) {
+		err_printf(&fctx, "%s", _("quotas not supported."));
+		goto out;
+	}
+	if (ext2fs_has_feature_verity(global_fs->super)) {
+		err_printf(&fctx, "%s", _("verity not supported."));
+		goto out;
+	}
+	if (ext2fs_has_feature_encrypt(global_fs->super)) {
+		err_printf(&fctx, "%s", _("encryption not supported."));
+		goto out;
+	}
+	if (ext2fs_has_feature_casefold(global_fs->super)) {
+		err_printf(&fctx, "%s", _("casefolding not supported."));
+		goto out;
+	}
+
+	if (ext2fs_has_feature_shared_blocks(global_fs->super))
+		fctx.ro = 1;
+
 	if (ext2fs_has_feature_journal_needs_recovery(global_fs->super)) {
 		if (fctx.norecovery) {
 			log_printf(&fctx, "%s\n",