Skip to contentSkip to conversation

common/quota: filter out option projquota in _qmount_option for ocfs2

PATCH In review Su Yue 2 participants 2 messages Jan 6, 2025 OCFS2

lore
Share & tools
lore

Su Yue

author
#0 lore raw

PATCH 1/1 common/quota: filter out option projquota in _qmount_option for ocfs2

ocfs2 doesn't support projquota but does support usrquota an grpquota. For now, two tests generic/594 and generic/603 are for testing usrquota,grpquota and projquota. The mount option 'projquota' causes failure of ocfs2 mount.

To make things simple, just skip the tests for ocfs2. However, we can't just put '_require_prjquota $SCRATCH_DEV' before _qmount because f2fs and xfs need runtime after mount of SCRATCH_DEV.

For ocfs2, filter out option 'projquota' in _qmount_option() to make _qmount successful. Then in _require_prjquota(), ocfs2 will fallthrough as a no kernel projquota support fs type.

---
 common/quota | 3 +++
 1 file changed, 3 insertions(+)
common/quota +3 -0
index 8135b7c044bf..8688116c6547 100644
@@ -325,6 +325,9 @@ _qmount_option()
 		OPTS=`echo $OPTS \
 		| sed	-e 's/\bpquota/quota/g'	\
 			-e 's/prjquota/quota/g'`
+	# ocfs2 doesn't support "-o projquota"
+	elif [[ "$FSTYP" == ocfs2 ]]; then
+		OPTS=`echo $OPTS | sed -e 's/prjquota//g'`
 	fi
 	# Ensure we have the given quota option - duplicates are fine
 	if [ -n "$OPTS" ]; then
Signature · 1 line
2.47.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Su Yue

ocfs2 doesn't support projquota but does support usrquota an grpquota. For now, two tests generic/594 and generic/603 are for testing usrquota,grpquota and projquota. The mount option 'projquota' causes failure of ocfs2 mount.

To make things simple, just skip the tests for ocfs2. However, we can't just put '_require_prjquota $SCRATCH_DEV' before _qmount because f2fs and xfs need runtime after mount of SCRATCH_DEV.

All _require_prjquota callers provide a $SCRATCH_DEV parameter, so changing the order and mkfsing / mounting to check support for f2fs and xfs should be an option. Still, this approach looks reasonable too: