From: Darrick J. Wong Date: Thu, 24 Apr 2025 21:41:02 +0000 (-0700) Subject: fuse2fs: refuse unsupported features X-Git-Tag: v1.47.3-rc1~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccbc6f24fed095b28f9faa7b575159e49787fae0;p=thirdparty%2Fe2fsprogs.git fuse2fs: refuse unsupported features Don't mount a filesystem with superblock features that we don't actually know how to support. Signed-off-by: Darrick J. Wong Link: https://lore.kernel.org/r/174553064943.1160461.14810321477577468832.stgit@frogsfrogsfrogs Signed-off-by: Theodore Ts'o --- diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c index 28443fcc..017f3658 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",