From patchwork Fri Mar 9 07:53:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sheng Yong X-Patchwork-Id: 10269809 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D0EFA6016D for ; Fri, 9 Mar 2018 07:53:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2190299CC for ; Fri, 9 Mar 2018 07:53:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6CA4299D3; Fri, 9 Mar 2018 07:53:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 377AC299CC for ; Fri, 9 Mar 2018 07:53:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbeCIHx1 (ORCPT ); Fri, 9 Mar 2018 02:53:27 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:50823 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751284AbeCIHx1 (ORCPT ); Fri, 9 Mar 2018 02:53:27 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 0603212E4B9D0; Fri, 9 Mar 2018 15:53:24 +0800 (CST) Received: from HULK-Android.huawei.com (10.113.189.218) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Fri, 9 Mar 2018 15:53:14 +0800 From: Sheng Yong To: , , , CC: , , Subject: [RFC PATCH 3/3] ext4: do not allow mount with test_dummy_encryption if encrypt not set Date: Fri, 9 Mar 2018 15:53:12 +0800 Message-ID: <20180309075312.62357-4-shengyong1@huawei.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180309075312.62357-1-shengyong1@huawei.com> References: <20180309075312.62357-1-shengyong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.113.189.218] X-CFilter-Loop: Reflected Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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; } /*