linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA
@ 2018-07-25 23:19 Chao Yu
  2018-07-26  1:41 ` Sheng Yong
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2018-07-25 23:19 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu

From: Chao Yu <yuchao0@huawei.com>

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 <yuchao0@huawei.com>
---
 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;
 	}
+	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)) {
-- 
2.16.2.17.g38e79b1fd

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA
  2018-07-25 23:19 [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA Chao Yu
@ 2018-07-26  1:41 ` Sheng Yong
  2018-07-26  1:53   ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Sheng Yong @ 2018-07-26  1:41 UTC (permalink / raw)
  To: Chao Yu, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

Hi, Chao

On 2018/7/26 7:19, Chao Yu wrote:
> From: Chao Yu <yuchao0@huawei.com>
> 
> 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 <yuchao0@huawei.com>
> ---
>   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)) {
> 


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [f2fs-dev] [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA
  2018-07-26  1:41 ` Sheng Yong
@ 2018-07-26  1:53   ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2018-07-26  1:53 UTC (permalink / raw)
  To: Sheng Yong, Chao Yu, jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

On 2018/7/26 9:41, Sheng Yong wrote:
> Hi, Chao
> 
> On 2018/7/26 7:19, Chao Yu wrote:
>> From: Chao Yu <yuchao0@huawei.com>
>>
>> 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 <yuchao0@huawei.com>
>> ---
>>   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)) {
>>
> 
> 
> .
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-26  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-25 23:19 [PATCH RESEND] f2fs: fix to restrict mount condition when without CONFIG_QUOTA Chao Yu
2018-07-26  1:41 ` Sheng Yong
2018-07-26  1:53   ` [f2fs-dev] " Chao Yu

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).