linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount
@ 2019-07-23  9:25 Chao Yu
  2019-07-23  9:25 ` [f2fs-dev] [PATCH 2/3] common/quota: support f2fs in _require_quota() and _check_quota_usage() Chao Yu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Chao Yu @ 2019-07-23  9:25 UTC (permalink / raw)
  To: guaneryu; +Cc: jaegeuk, chao, fstests, linux-f2fs-devel

Move _require_prjquota() to front of _qmount() since we do the
check on device directly instead of mountpoint, it can avoid
potential failure if filesystem utils needs exclusive open on
device.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 tests/generic/383 | 2 +-
 tests/generic/384 | 2 +-
 tests/generic/385 | 2 +-
 tests/generic/386 | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/generic/383 b/tests/generic/383
index 2c8c5923..cf5ac255 100755
--- a/tests/generic/383
+++ b/tests/generic/383
@@ -39,6 +39,7 @@ _require_xfs_quota_foreign
 
 _scratch_mkfs >/dev/null 2>&1
 _scratch_enable_pquota
+_require_prjquota $SCRATCH_DEV
 
 do_project_test()
 {
@@ -76,7 +77,6 @@ EOF
 # Test project
 _qmount_option "usrquota,prjquota"
 _qmount
-_require_prjquota $SCRATCH_DEV
 do_project_test
 
 # success, all done
diff --git a/tests/generic/384 b/tests/generic/384
index b7c940d7..2c0cd00b 100755
--- a/tests/generic/384
+++ b/tests/generic/384
@@ -57,10 +57,10 @@ chmod a+rwx $seqres.full	# arbitrary users will write here
 _require_scratch
 _scratch_mkfs >/dev/null 2>&1
 _scratch_enable_pquota
+_require_prjquota $SCRATCH_DEV
 
 _qmount_option "prjquota"
 _qmount
-_require_prjquota $SCRATCH_DEV
 
 report_quota()
 {
diff --git a/tests/generic/385 b/tests/generic/385
index 937131a9..56ce6eb0 100755
--- a/tests/generic/385
+++ b/tests/generic/385
@@ -56,9 +56,9 @@ quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
 
 _scratch_mkfs >/dev/null 2>&1
 _scratch_enable_pquota
+_require_prjquota $SCRATCH_DEV
 _qmount_option "prjquota"
 _qmount
-_require_prjquota $SCRATCH_DEV
 
 #
 # Create the project root
diff --git a/tests/generic/386 b/tests/generic/386
index 462c5869..e4f7d23b 100755
--- a/tests/generic/386
+++ b/tests/generic/386
@@ -112,10 +112,10 @@ echo $proj_num:$proj_dir > "$my_projects"
 
 _scratch_mkfs					>> "$seqres.full" 2>&1
 _scratch_enable_pquota
+_require_prjquota $SCRATCH_DEV
 
 _qmount_option "prjquota"
 _qmount
-_require_prjquota $SCRATCH_DEV
 
 mkdir -p "${proj_dir}"
 
-- 
2.18.0.rc1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* [f2fs-dev] [PATCH 2/3] common/quota: support f2fs in _require_quota() and _check_quota_usage()
  2019-07-23  9:25 [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Chao Yu
@ 2019-07-23  9:25 ` Chao Yu
  2019-07-23  9:25 ` [f2fs-dev] [PATCH 3/3] common/rc: check quota sysfile feature for f2fs Chao Yu
  2019-07-28  9:51 ` [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Eryu Guan
  2 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2019-07-23  9:25 UTC (permalink / raw)
  To: guaneryu; +Cc: jaegeuk, chao, fstests, linux-f2fs-devel

This can let f2fs pass the check of quota testcases.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 common/quota | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/common/quota b/common/quota
index f19f81a1..9af280a2 100644
--- a/common/quota
+++ b/common/quota
@@ -12,7 +12,7 @@ _require_quota()
     [ -n "$QUOTA_PROG" ] || _notrun "Quota user tools not installed"
 
     case $FSTYP in
-    ext2|ext3|ext4|ext4dev|reiserfs)
+    ext2|ext3|ext4|ext4dev|f2fs|reiserfs)
 	if [ ! -d /proc/sys/fs/quota ]; then
 	    _notrun "Installed kernel does not support quotas"
 	fi
@@ -257,7 +257,7 @@ _check_quota_usage()
 
 	VFS_QUOTA=0
 	case $FSTYP in
-	ext2|ext3|ext4|ext4dev|reiserfs|gfs2)
+	ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2)
 		VFS_QUOTA=1
 		quotaon -f -u -g $SCRATCH_MNT 2>/dev/null
 		;;
-- 
2.18.0.rc1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* [f2fs-dev] [PATCH 3/3] common/rc: check quota sysfile feature for f2fs
  2019-07-23  9:25 [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Chao Yu
  2019-07-23  9:25 ` [f2fs-dev] [PATCH 2/3] common/quota: support f2fs in _require_quota() and _check_quota_usage() Chao Yu
@ 2019-07-23  9:25 ` Chao Yu
  2019-07-28  9:51 ` [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Eryu Guan
  2 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2019-07-23  9:25 UTC (permalink / raw)
  To: guaneryu; +Cc: jaegeuk, chao, fstests, linux-f2fs-devel

In _require_prjquota(), f2fs missed to check whether we have enabled
quota sysfile feature in the image, add it.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
 common/quota | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/quota b/common/quota
index 9af280a2..3f46eb19 100644
--- a/common/quota
+++ b/common/quota
@@ -80,6 +80,8 @@ _require_prjquota()
     if [ "$FSTYP" == "f2fs" ]; then
 	dump.f2fs $_dev 2>&1 | grep -qw project_quota
 	[ $? -ne 0 ] && _notrun "Project quota not enabled in this device $_dev"
+	dump.f2fs $_dev 2>&1 | grep -qw quota_ino
+	[ $? -ne 0 ] && _notrun "quota sysfile not enabled in this device $_dev"
 	cat /sys/fs/f2fs/features/project_quota | grep -qw supported
 	[ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
 	return
-- 
2.18.0.rc1



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount
  2019-07-23  9:25 [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Chao Yu
  2019-07-23  9:25 ` [f2fs-dev] [PATCH 2/3] common/quota: support f2fs in _require_quota() and _check_quota_usage() Chao Yu
  2019-07-23  9:25 ` [f2fs-dev] [PATCH 3/3] common/rc: check quota sysfile feature for f2fs Chao Yu
@ 2019-07-28  9:51 ` Eryu Guan
  2019-07-29 11:43   ` Chao Yu
  2 siblings, 1 reply; 5+ messages in thread
From: Eryu Guan @ 2019-07-28  9:51 UTC (permalink / raw)
  To: Chao Yu; +Cc: jaegeuk, chao, fstests, linux-f2fs-devel

On Tue, Jul 23, 2019 at 05:25:27PM +0800, Chao Yu wrote:
> Move _require_prjquota() to front of _qmount() since we do the
> check on device directly instead of mountpoint, it can avoid
> potential failure if filesystem utils needs exclusive open on
> device.
> 
> Signed-off-by: Chao Yu <yuchao0@huawei.com>

We've done similar changes before

23f60ef304d6 ("generic/38[3-6]: require project quota to be enabled on
SCRATCH_DEV")

but later it was reverted by

f722c48d4cd5 ("Revert "generic/38[3-6]: require project quota to be
enabled on SCRATCH_DEV"")

Because we use quotactl(2) to check if prjquota is enabled on the given
device (src/feature -P $dev in _require_prjquota), and quotactl(2)
requires the given device is a mounted device.

Thanks,
Eryu

> ---
>  tests/generic/383 | 2 +-
>  tests/generic/384 | 2 +-
>  tests/generic/385 | 2 +-
>  tests/generic/386 | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/generic/383 b/tests/generic/383
> index 2c8c5923..cf5ac255 100755
> --- a/tests/generic/383
> +++ b/tests/generic/383
> @@ -39,6 +39,7 @@ _require_xfs_quota_foreign
>  
>  _scratch_mkfs >/dev/null 2>&1
>  _scratch_enable_pquota
> +_require_prjquota $SCRATCH_DEV
>  
>  do_project_test()
>  {
> @@ -76,7 +77,6 @@ EOF
>  # Test project
>  _qmount_option "usrquota,prjquota"
>  _qmount
> -_require_prjquota $SCRATCH_DEV
>  do_project_test
>  
>  # success, all done
> diff --git a/tests/generic/384 b/tests/generic/384
> index b7c940d7..2c0cd00b 100755
> --- a/tests/generic/384
> +++ b/tests/generic/384
> @@ -57,10 +57,10 @@ chmod a+rwx $seqres.full	# arbitrary users will write here
>  _require_scratch
>  _scratch_mkfs >/dev/null 2>&1
>  _scratch_enable_pquota
> +_require_prjquota $SCRATCH_DEV
>  
>  _qmount_option "prjquota"
>  _qmount
> -_require_prjquota $SCRATCH_DEV
>  
>  report_quota()
>  {
> diff --git a/tests/generic/385 b/tests/generic/385
> index 937131a9..56ce6eb0 100755
> --- a/tests/generic/385
> +++ b/tests/generic/385
> @@ -56,9 +56,9 @@ quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
>  
>  _scratch_mkfs >/dev/null 2>&1
>  _scratch_enable_pquota
> +_require_prjquota $SCRATCH_DEV
>  _qmount_option "prjquota"
>  _qmount
> -_require_prjquota $SCRATCH_DEV
>  
>  #
>  # Create the project root
> diff --git a/tests/generic/386 b/tests/generic/386
> index 462c5869..e4f7d23b 100755
> --- a/tests/generic/386
> +++ b/tests/generic/386
> @@ -112,10 +112,10 @@ echo $proj_num:$proj_dir > "$my_projects"
>  
>  _scratch_mkfs					>> "$seqres.full" 2>&1
>  _scratch_enable_pquota
> +_require_prjquota $SCRATCH_DEV
>  
>  _qmount_option "prjquota"
>  _qmount
> -_require_prjquota $SCRATCH_DEV
>  
>  mkdir -p "${proj_dir}"
>  
> -- 
> 2.18.0.rc1
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

* Re: [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount
  2019-07-28  9:51 ` [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Eryu Guan
@ 2019-07-29 11:43   ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2019-07-29 11:43 UTC (permalink / raw)
  To: Eryu Guan; +Cc: jaegeuk, chao, fstests, linux-f2fs-devel

On 2019/7/28 17:51, Eryu Guan wrote:
> On Tue, Jul 23, 2019 at 05:25:27PM +0800, Chao Yu wrote:
>> Move _require_prjquota() to front of _qmount() since we do the
>> check on device directly instead of mountpoint, it can avoid
>> potential failure if filesystem utils needs exclusive open on
>> device.
>>
>> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> 
> We've done similar changes before
> 
> 23f60ef304d6 ("generic/38[3-6]: require project quota to be enabled on
> SCRATCH_DEV")
> 
> but later it was reverted by
> 
> f722c48d4cd5 ("Revert "generic/38[3-6]: require project quota to be
> enabled on SCRATCH_DEV"")
> 
> Because we use quotactl(2) to check if prjquota is enabled on the given
> device (src/feature -P $dev in _require_prjquota), and quotactl(2)
> requires the given device is a mounted device.

You're right, let's ignore this patch. BTW, in order to fix f2fs failure on
these testcases, I'm trying to let dump.f2fs be able to check superblock on a
mounted device.

Thanks,

> 
> Thanks,
> Eryu
> 
>> ---
>>  tests/generic/383 | 2 +-
>>  tests/generic/384 | 2 +-
>>  tests/generic/385 | 2 +-
>>  tests/generic/386 | 2 +-
>>  4 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/tests/generic/383 b/tests/generic/383
>> index 2c8c5923..cf5ac255 100755
>> --- a/tests/generic/383
>> +++ b/tests/generic/383
>> @@ -39,6 +39,7 @@ _require_xfs_quota_foreign
>>  
>>  _scratch_mkfs >/dev/null 2>&1
>>  _scratch_enable_pquota
>> +_require_prjquota $SCRATCH_DEV
>>  
>>  do_project_test()
>>  {
>> @@ -76,7 +77,6 @@ EOF
>>  # Test project
>>  _qmount_option "usrquota,prjquota"
>>  _qmount
>> -_require_prjquota $SCRATCH_DEV
>>  do_project_test
>>  
>>  # success, all done
>> diff --git a/tests/generic/384 b/tests/generic/384
>> index b7c940d7..2c0cd00b 100755
>> --- a/tests/generic/384
>> +++ b/tests/generic/384
>> @@ -57,10 +57,10 @@ chmod a+rwx $seqres.full	# arbitrary users will write here
>>  _require_scratch
>>  _scratch_mkfs >/dev/null 2>&1
>>  _scratch_enable_pquota
>> +_require_prjquota $SCRATCH_DEV
>>  
>>  _qmount_option "prjquota"
>>  _qmount
>> -_require_prjquota $SCRATCH_DEV
>>  
>>  report_quota()
>>  {
>> diff --git a/tests/generic/385 b/tests/generic/385
>> index 937131a9..56ce6eb0 100755
>> --- a/tests/generic/385
>> +++ b/tests/generic/385
>> @@ -56,9 +56,9 @@ quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
>>  
>>  _scratch_mkfs >/dev/null 2>&1
>>  _scratch_enable_pquota
>> +_require_prjquota $SCRATCH_DEV
>>  _qmount_option "prjquota"
>>  _qmount
>> -_require_prjquota $SCRATCH_DEV
>>  
>>  #
>>  # Create the project root
>> diff --git a/tests/generic/386 b/tests/generic/386
>> index 462c5869..e4f7d23b 100755
>> --- a/tests/generic/386
>> +++ b/tests/generic/386
>> @@ -112,10 +112,10 @@ echo $proj_num:$proj_dir > "$my_projects"
>>  
>>  _scratch_mkfs					>> "$seqres.full" 2>&1
>>  _scratch_enable_pquota
>> +_require_prjquota $SCRATCH_DEV
>>  
>>  _qmount_option "prjquota"
>>  _qmount
>> -_require_prjquota $SCRATCH_DEV
>>  
>>  mkdir -p "${proj_dir}"
>>  
>> -- 
>> 2.18.0.rc1
>>
> .
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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

end of thread, other threads:[~2019-07-29 11:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23  9:25 [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Chao Yu
2019-07-23  9:25 ` [f2fs-dev] [PATCH 2/3] common/quota: support f2fs in _require_quota() and _check_quota_usage() Chao Yu
2019-07-23  9:25 ` [f2fs-dev] [PATCH 3/3] common/rc: check quota sysfile feature for f2fs Chao Yu
2019-07-28  9:51 ` [f2fs-dev] [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Eryu Guan
2019-07-29 11:43   ` 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).