Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1442378imm; Wed, 25 Jul 2018 18:54:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpclStSaiXML8vl1EQZTaACJHqWBRnl4AoI3KMX/CpEWvfdYfJFKtpWmC4ooHiDfJUAvYmzE X-Received: by 2002:a63:5c52:: with SMTP id n18-v6mr22488924pgm.360.1532570077193; Wed, 25 Jul 2018 18:54:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532570077; cv=none; d=google.com; s=arc-20160816; b=k7KRYnvuJpiCxdGE05hfdZ8sy3HLloeOiYeEGaxd8Z635Itb0G12QuF77xR8gUg8LF UmeY26wLqIgTd3s+yM+TMxb5NXIh5OQeMLOnv5qtRxNQgmz2FMtbEU0sW4flnnKZXn59 uMAaCEI14jvprNR5WiJ17sK3YLstnuQm4LKXxMexzztoFLm4rrhMWUQBhVfZCeoIq+Nh u9At1tu9NPWDBb3+qv8EX1TlH3DKr2MLKXiy3iK2e5la+pNyRQtXtaFKtIB2LXZK1FBf MQgn1a4jyo5ArnivHzQ118dLs4gdS6i6/BXHaSzjb8y8e7KaukipQJE3QreAAS9jbNlm QNwg== 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=QIG1rHjl7dPU4C6tI5btohQ8dgPbW9AkoSoUYR1f7N0=; b=NNq35rvY2lIltWuaubfR+a+O7iBmUIp/m80vpMK+5wsAlG3q9ip9LRaEvDrtaM7PHG AUArbMQm2MzLQT18v09MmwKw4SFZl7ViPyFWsHes3J+rWL2Oseml5JEeSbO4pd8IrEQK 1jNRs63y5ItTvtp6HecNkYEuq3TBwgQ/YOfJZe2leTCovcjvm7Jt7n6qzHT6YE5nhKUv QMzrQSvOe3FuDUbpJ1+takqSOrD7xBgeR+C3zY+GJZWodmomzw/nwr4gVGAdw/ADc0UT Snu/sdCkMRO7rartC8Bds3wZXC6VzoZ8LdJyMvDYEgHNcYtoON5LoBa7pyM0G4ZJoKZv 6sEw== 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 37-v6si44634pgy.118.2018.07.25.18.54.22; Wed, 25 Jul 2018 18:54:37 -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 S1728615AbeGZDH6 (ORCPT + 99 others); Wed, 25 Jul 2018 23:07:58 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:10123 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728352AbeGZDH6 (ORCPT ); Wed, 25 Jul 2018 23:07:58 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6C780CAF0EC0C; Thu, 26 Jul 2018 09:53:29 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.382.0; Thu, 26 Jul 2018 09:53:21 +0800 Subject: Re: [f2fs-dev] [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA To: Sheng Yong , Chao Yu , CC: , References: <20180725231948.18075-1-chao@kernel.org> <4b46f8b3-2858-a528-de53-c2de333c3314@huawei.com> From: Chao Yu Message-ID: <0b69dfb2-098d-c986-9cdf-f6eac08cba76@huawei.com> Date: Thu, 26 Jul 2018 09:53:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <4b46f8b3-2858-a528-de53-c2de333c3314@huawei.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/7/26 9:41, Sheng Yong wrote: > 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" :) I wrote this patch based on yours, so I think the code actually locates in the right place. Please check serials on below link: https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=f2fs-dev > > 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)) { >> > > > . >