linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4 crypto: prevent mount when blocksize != pagesize
@ 2015-06-11 15:12 Seunghun Lee
  2015-06-13  3:45 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Seunghun Lee @ 2015-06-11 15:12 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4, linux-kernel, Seunghun Lee

Encryption mode is unsupported when blocksize != pagesize.

Signed-off-by: Seunghun Lee <waydi1@gmail.com>
---
 fs/ext4/super.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 31e85be..032c9e3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1583,6 +1583,15 @@ static int handle_mount_opt(struct super_block *sb, char *opt, int token,
 			IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, arg);
 	} else if (token == Opt_test_dummy_encryption) {
 #ifdef CONFIG_EXT4_FS_ENCRYPTION
+		int blocksize =
+			BLOCK_SIZE << le32_to_cpu(sbi->s_es->s_log_block_size);
+
+		if (blocksize != PAGE_CACHE_SIZE) {
+			ext4_msg(sb, KERN_ERR,
+				"unsupported blocksize for Test dummy encryption mode");
+			return -1;
+		}
+
 		sbi->s_mount_flags |= EXT4_MF_TEST_DUMMY_ENCRYPTION;
 		ext4_msg(sb, KERN_WARNING,
 			 "Test dummy encryption mode enabled");
-- 
2.3.5


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

end of thread, other threads:[~2015-06-13  3:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-11 15:12 [PATCH] ext4 crypto: prevent mount when blocksize != pagesize Seunghun Lee
2015-06-13  3:45 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).