]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
fuse2fs: refuse unsupported features
authorDarrick J. Wong <djwong@kernel.org>
Thu, 24 Apr 2025 21:41:02 +0000 (14:41 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 9 Jun 2025 20:08:02 +0000 (16:08 -0400)
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>
Link: https://lore.kernel.org/r/174553064943.1160461.14810321477577468832.stgit@frogsfrogsfrogs
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
(cherry picked from commit ccbc6f24fed095b28f9faa7b575159e49787fae0)

misc/fuse2fs.c

index a6390ab5d8c61bfe47bbdc833155499c71e8f639..2e04632019bd4af60363e1c761fcdc8078febbbf 100644 (file)
@@ -3863,6 +3863,26 @@ int main(int argc, char *argv[])
 
        ret = 3;
 
+       if (ext2fs_has_feature_quota(global_fs->super)) {
+               printf(_("%s: quotas not supported."), fctx.device);
+               goto out;
+       }
+       if (ext2fs_has_feature_verity(global_fs->super)) {
+               printf(_("%s: verity not supported."), fctx.device);
+               goto out;
+       }
+       if (ext2fs_has_feature_encrypt(global_fs->super)) {
+               printf(_("%s: encryption not supported."), fctx.device);
+               goto out;
+       }
+       if (ext2fs_has_feature_casefold(global_fs->super)) {
+               printf(_("%s: casefolding not supported."), fctx.device);
+               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) {
                        printf(_("%s: mounting read-only without "