Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1434592imm; Wed, 25 Jul 2018 18:43:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd1oFZoOi68MpAXwQpj284RYhxd+svj1vJB9S/JXeYf5UZCk2wYiFlBKqudqNQkR8Idh5zl X-Received: by 2002:a63:27c1:: with SMTP id n184-v6mr22024232pgn.29.1532569436946; Wed, 25 Jul 2018 18:43:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532569436; cv=none; d=google.com; s=arc-20160816; b=B0c6mRK0+D8TLIFq1jVm1nhQz1EbrtOaImyroUYDXPTYT6eaOWiBAlwx4S1Vi0cb7l 0GiFtLlw5Z6/Ln2tEZQaObgZpPKmK2RC7nSKd1P8zYoqtnmNksr4vbZpppTcDDjYveqF oaDgubZNL0j/7BD0KMVX/A8oIiqE8GbrWjuw+8y54TpdZ/YlxfKY6jW4bdotjaFFtLsJ ijJpSqmIbmiHxxV/iEJwGBDaghlfHbokidWeqiwAfw7CGfkEmA7hUD/jBJL/mEREebxZ FZ71F8QQ0PQIQkoP7okyUrPTfoQhRdeyQOfb3SEfNaf1r0r0vg9llgfDdI1Y5OPqsimg H+wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=3iacnZNsSzGyDFL1NnL3mbqVOxD0cS0fLgt8LwbQqj4=; b=rt0DnA84IEdiCJqVRlrQ8pZLD8lwv34+z0u+oQzNbh35J3Y+uqYkTY+/QrDnR9DXiB rHPMO8f9UkMWeWIOME4JRcWvdel+b4Dl8SP8txEFF2jy2PEDR45pvc+j6/LZyMUxWLFc MtlApP/dXPzg0UDlaV66hmI5HOWYKkzDtxKDbSg+/zsZVmcsCBhimY3pLkhEhx+XSqJ9 CAE9/wBjoIQ+s1euCCNNQ6JRf8Ec6OJUTTVwbVXA4uVDM+JLZL1t2fT/8ryMpGc3Yh8w QDR0gQ/YxkkZmcT8dIdDw6oFrzuZwLJIF/NaODGO/N5KV9Gh/IoZRtStUz7OcN0bsKkY ZmZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u184-v6si32683pgd.31.2018.07.25.18.43.27; Wed, 25 Jul 2018 18:43:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728547AbeGZC4a (ORCPT + 99 others); Wed, 25 Jul 2018 22:56:30 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:46280 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728378AbeGZC4a (ORCPT ); Wed, 25 Jul 2018 22:56:30 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 9E84FEA56AC1E; Thu, 26 Jul 2018 09:42:04 +0800 (CST) Received: from [127.0.0.1] (10.111.221.165) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.382.0; Thu, 26 Jul 2018 09:42:00 +0800 Subject: Re: [f2fs-dev] [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA To: Chao Yu , CC: , References: <20180725231948.18075-1-chao@kernel.org> From: Sheng Yong Message-ID: <4b46f8b3-2858-a528-de53-c2de333c3314@huawei.com> Date: Thu, 26 Jul 2018 09:41:55 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20180725231948.18075-1-chao@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.221.165] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Chao On 2018/7/26 7:19, Chao Yu wrote: > From: Chao Yu > > Like quota_ino feature, we need to reject mounting RDWR with image > which enables project_quota feature when there is no CONFIG_QUOTA > be set in kernel. > > Signed-off-by: Chao Yu > --- > fs/f2fs/super.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index dbc1cb53581f..bc7c14a055bb 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -775,6 +775,12 @@ static int parse_options(struct super_block *sb, char *options) > "without CONFIG_QUOTA"); > return -EINVAL; > } I think the following should be checked within !CONFIG_QUOTA, like patch "f2fs: quota: do not mount as RDWR without QUOTA if quota feature enabled" :) thanks > + if (f2fs_sb_has_project_quota(sbi->sb) && !f2fs_readonly(sbi->sb)) { > + f2fs_msg(sb, KERN_ERR, > + "Filesystem with project quota feature cannot be " > + "mounted RDWR without CONFIG_QUOTA"); > + return -EINVAL; > + } > #endif > > if (F2FS_IO_SIZE_BITS(sbi) && !test_opt(sbi, LFS)) { >