Skip to contentSkip to conversation

f2fs/015: Fix mount syntax for disabling jquota

PATCH In review Joanne Chang 3 participants 5 messages May 13 – May 15

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 f2fs/015: Fix mount syntax for disabling jquota

F2FS has removed the trailing "=" in the mount options for disabling user, group, and project journaled quotas. To maintain compatibility, update the test cases in f2fs/015 to try the new syntax first, and fall back to the legacy syntax if the initial mount attempt fails.

---
 tests/f2fs/015     | 13 +++++++++----
 tests/f2fs/015.out |  6 +++---
 2 files changed, 12 insertions(+), 7 deletions(-)
tests/f2fs/015 +9 -4
index 81ea9818..54cada4a 100755
@@ -66,9 +66,9 @@ options=(
 	"usrjquota=ausrquota"		""			\
 	"grpjquota=agrpquota"		""			\
 	"prjjquota=aprjquota"		""			\
-	"usrjquota="			""			\
-	"grpjquota="			""			\
-	"prjjquota="			""			\
+	"usrjquota"			""			\
+	"grpjquota"			""			\
+	"prjjquota"			""			\
 	"usrjquota=ausrquota"		"extra_attr,quota,project_quota"	\
 	"grpjquota=agrpquota"		"extra_attr,quota,project_quota"	\
 	"prjjquota=aprjquota"		"extra_attr,quota,project_quota"	\
@@ -119,7 +119,12 @@ do
 	else
 		_scratch_mkfs >> $seqres.full || _fail "mkfs failed"
 	fi
-	_try_scratch_mount "-o ${options[$i]}" >> $seqres.full 2>&1
+	if [[ "${options[$i]}" == *jquota ]]; then
+		_try_scratch_mount "-o ${options[$i]}" >> $seqres.full 2>&1 || \
+			_try_scratch_mount "-o ${options[$i]}=" >> $seqres.full 2>&1
+	else
+		_try_scratch_mount "-o ${options[$i]}" >> $seqres.full 2>&1
+	fi
 	echo $?
 	_scratch_unmount >> $seqres.full 2>&1
 done
tests/f2fs/015.out +3 -3
index cd273550..45ef9ea8 100644
@@ -101,11 +101,11 @@ Option#98: grpjquota=agrpquota :
 32
 Option#100: prjjquota=aprjquota : 
 32
-Option#102: usrjquota= : 
+Option#102: usrjquota : 
 0
-Option#104: grpjquota= : 
+Option#104: grpjquota : 
 0
-Option#106: prjjquota= : 
+Option#106: prjjquota : 
 0
 Option#108: usrjquota=ausrquota : extra_attr,quota,project_quota
 0
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
#1 lore raw

PATCH 2/2 f2fs/021: Fix mount syntax for disabling jquota

F2FS has removed the trailing "=" in the mount options for disabling user journaled quotas. Update f2fs/021 to try the new syntax first and fall back to the legacy syntax if the initial mount attempt fails.

---
 tests/f2fs/021 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/f2fs/021 +3 -1
index 0cacb138..70b10fa8 100755
@@ -21,7 +21,9 @@ quotacheck -uc $SCRATCH_MNT
 _scratch_unmount
 
 _scratch_mount "-o usrjquota=aquota.user,jqfmt=vfsold"
-_scratch_mount "-o remount,usrjquota=,jqfmt=vfsold"
+if ! _try_scratch_mount "-o remount,usrjquota,jqfmt=vfsold" >> $seqres.full 2>&1; then
+	_scratch_mount "-o remount,usrjquota=,jqfmt=vfsold"
+fi
 _scratch_unmount
 
 echo "Silence is golden"
Signature · 1 line
2.54.0.563.g4f69b47b94-goog
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH v1 2/2] f2fs/021: Fix mount syntax for disabling jquota

Quoted 5 lines · Joanne Chang

F2FS has removed the trailing "=" in the mount options for disabling user journaled quotas. Update f2fs/021 to try the new syntax first and fall back to the legacy syntax if the initial mount attempt fails.

Thanks,

#3 lore raw

Re: [PATCH v1 2/2] f2fs/021: Fix mount syntax for disabling jquota

In reply to Joanne Chang
Quoted 14 lines · Joanne Chang

F2FS has removed the trailing "=" in the mount options for disabling user journaled quotas. Update f2fs/021 to try the new syntax first and fall back to the legacy syntax if the initial mount attempt fails.

---
 tests/f2fs/021 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/f2fs/021 +0 -0
index 0cacb138..70b10fa8 100755

tests/f2fs/021 quotacheck -uc $SCRATCH_MNT · line 26

Quoted 7 lines
tests/f2fs/021 +3 -1
@@ -21,7 +21,9 @@ quotacheck -uc $SCRATCH_MNT
 _scratch_unmount
 
 _scratch_mount "-o usrjquota=aquota.user,jqfmt=vfsold"
-_scratch_mount "-o remount,usrjquota=,jqfmt=vfsold"
+if ! _try_scratch_mount "-o remount,usrjquota,jqfmt=vfsold" >> $seqres.full 2>&1; then
+	_scratch_mount "-o remount,usrjquota=,jqfmt=vfsold"
+fi

I’ve explored several ways to solve this more elegantly. Otherwise, every single F2FS quota test case might run into this exact same issue. but I can't find any good idea currently. For example, if we do something in _try_scratch_mount:

	local mount_opts=`_scratch_mount_options $*`
	if [ "$FSTYP" == "f2fs" ]; then
		mount_opts=`_f2fs_quota_options "$mount_opts"`
	fi

However, F2FS seems to only distinguish the '=' usage through a trial mount, so doing it inside _try_scratch_mount is definitely not a good idea. Is there a way to probe this without mounting? Like relying on some --help output or something similar? Any good ideas from others?

Thanks,
Zorro

Quoted 6 lines
tests/f2fs/021 +0 -0
 _scratch_unmount
 
 echo "Silence is golden"
Signature · 1 line
2.54.0.563.g4f69b47b94-goog