[RFC PATCH 3/3] ext4: do not allow mount with test_dummy_encryption if encrypt not set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When mounting with test_dummy_encryption option, if encrypt feature
is not set, return fail instead of setting encrypt feature forcely.

CC: linux-ext4@xxxxxxxxxxxxxxx
Signed-off-by: Sheng Yong <shengyong1@xxxxxxxxxx>
---
 fs/ext4/super.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 39bf464c35f1..c424af0ccda9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4151,8 +4151,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
 
 	if (DUMMY_ENCRYPTION_ENABLED(sbi) && !sb_rdonly(sb) &&
 	    !ext4_has_feature_encrypt(sb)) {
-		ext4_set_feature_encrypt(sb);
-		ext4_commit_super(sb, 1);
+		ext4_msg(sb, KERN_ERR,
+			 "Encrypt does not support or filesystem is read-only");
+		goto failed_mount_wq;
 	}
 
 	/*
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe linux-fscrypt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux