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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 39bf464c35f1..1a253342b09e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4149,10 +4149,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent) goto failed_mount_wq; } - if (DUMMY_ENCRYPTION_ENABLED(sbi) && !sb_rdonly(sb) && - !ext4_has_feature_encrypt(sb)) { - ext4_set_feature_encrypt(sb); - ext4_commit_super(sb, 1); + if (DUMMY_ENCRYPTION_ENABLED(sbi) && !ext4_has_feature_encrypt(sb)) { + ext4_msg(sb, KERN_ERR, "Encrypt does not support"); + goto failed_mount_wq; } /* -- 2.16.2 -- 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