linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, yuchao0@huawei.com, ebiggers@google.com,
	tytso@mit.edu
Cc: linux-fscrypt@vger.kernel.org, miaoxie@huawei.com,
	linux-f2fs-devel@lists.sourceforge.net
Subject: [RFC PATCH v5 3/3] ext4: do not allow mount with test_dummy_encryption if encrypt not set
Date: Thu, 15 Mar 2018 18:51:43 +0800	[thread overview]
Message-ID: <20180315105143.133050-4-shengyong1@huawei.com> (raw)
In-Reply-To: <20180315105143.133050-1-shengyong1@huawei.com>

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

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
 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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

      parent reply	other threads:[~2018-03-15 10:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 10:51 [RFC PATCH v5 0/3] f2fs: introduce F2FS_FEATURE_LOST_FOUND feature Sheng Yong
2018-03-15 10:51 ` [RFC PATCH v5 1/3] " Sheng Yong
2018-03-15 10:51 ` [RFC PATCH v5 2/3] f2fs: introduce a new mount option test_dummy_encryption Sheng Yong
2018-03-16  8:49   ` Chao Yu
2018-03-15 10:51 ` Sheng Yong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180315105143.133050-4-shengyong1@huawei.com \
    --to=shengyong1@huawei.com \
    --cc=ebiggers@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=tytso@mit.edu \
    --cc=yuchao0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).