Skip to contentSkip to conversation

common/quota: fix keywords of quota feature in _require_prjquota() for f2fs

PATCH Superseded Chao Yu 2 participants 3 messages Apr 16, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 common/quota: fix keywords of quota feature in _require_prjquota() for f2fs

Previously, in f2fs, sysfile quota feature has different name:
- "quota" in mkfs.f2fs
- and "quota_ino" in dump.f2fs

Now, it has unified the name to "quota" since commit 92cc5edeb7 ("f2fs-tools: reuse feature_table to clean up print_sb_state()").

It needs to fix keywords in _require_prjquota() for f2fs, Otherwise, quota testcase will fail.

generic/383 1s ... [not run] quota sysfile not enabled in this device /dev/vdc

Cc Jaegeuk Kim <[email protected]>
---
 common/quota | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/quota +1 -1
index 6b529bf4..cfe3276f 100644
@@ -145,7 +145,7 @@ _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
+	dump.f2fs $_dev 2>&1 | grep -qw quota
 	[ $? -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"
Signature · 1 line
2.40.1
#1 lore raw
Quoted 23 lines · Chao Yu

Previously, in f2fs, sysfile quota feature has different name:
- "quota" in mkfs.f2fs
- and "quota_ino" in dump.f2fs

Now, it has unified the name to "quota" since commit 92cc5edeb7 ("f2fs-tools: reuse feature_table to clean up print_sb_state()").

It needs to fix keywords in _require_prjquota() for f2fs, Otherwise, quota testcase will fail.

generic/383 1s ... [not run] quota sysfile not enabled in this device /dev/vdc

Cc Jaegeuk Kim <[email protected]>
---
 common/quota | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/quota +0 -0
index 6b529bf4..cfe3276f 100644

common/quota _require_prjquota() · line 148

Quoted 5 lines
common/quota +1 -1
@@ -145,7 +145,7 @@ _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
+	dump.f2fs $_dev 2>&1 | grep -qw quota

This will _notrun on old f2fs-tools, due to grep -w quota doesn't match old "quota_ino". So how about grep -Eqw "quota|quota_ino", or any better idea you have.

Thanks,
Zorro

Quoted 7 lines
common/quota +0 -0
 	[ $? -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"
Signature · 1 line
2.40.1
author
#2 lore raw
Quoted 19 lines · Zorro Lang
Quoted 18 lines · Chao Yu

Previously, in f2fs, sysfile quota feature has different name:
- "quota" in mkfs.f2fs
- and "quota_ino" in dump.f2fs

Now, it has unified the name to "quota" since commit 92cc5edeb7 ("f2fs-tools: reuse feature_table to clean up print_sb_state()").

It needs to fix keywords in _require_prjquota() for f2fs, Otherwise, quota testcase will fail.

generic/383 1s ... [not run] quota sysfile not enabled in this device /dev/vdc

Cc Jaegeuk Kim <[email protected]>
---
  common/quota | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

common/quota _require_prjquota() · line 148

Quoted 10 lines
common/quota +1 -1
index 6b529bf4..cfe3276f 100644
@@ -145,7 +145,7 @@ _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
+	dump.f2fs $_dev 2>&1 | grep -qw quota

This will _notrun on old f2fs-tools, due to grep -w quota doesn't match old "quota_ino". So how about grep -Eqw "quota|quota_ino", or any better idea you have.

Thanks for your suggestion, I fix this in v2, I've tested v2 w/ old f2fs-tools, it works fine.

Thanks,

Quoted 12 lines

Thanks,
Zorro

Quoted 7 lines
common/quota +0 -0
  	[ $? -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"
Signature · 1 line
2.40.1