File: 0006-fuse2fs-refuse-unsupported-features.patch

package info (click to toggle)
e2fsprogs 1.47.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 44,040 kB
  • sloc: ansic: 132,791; sh: 7,273; makefile: 5,315; awk: 524; perl: 376; cpp: 207; sed: 186; python: 23
file content (45 lines) | stat: -rw-r--r-- 1,307 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From: "Darrick J. Wong" <djwong@kernel.org>
Subject: fuse2fs: refuse unsupported features

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

Origin: upstream, https://github.com/tytso/e2fsprogs/commit/ccbc6f24fed095b28f9faa7b575159e49787fae0
---
 misc/fuse2fs.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index a6390ab5d..2e0463201 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -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 "
-- 
2.47.2