common/quota: enable project quota correctly on f2fs
authorChao Yu <yuchao0@huawei.com>
Mon, 29 Jul 2019 11:56:20 +0000 (19:56 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 4 Aug 2019 10:29:53 +0000 (18:29 +0800)
Add a case for f2fs on _scratch_enable_pquota() to enable
dependent features of project quota by mkfs.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/quota

index 659c6219541149613e655737a11926bd529f70c2..5e154fad6a35d1ab5aec4a5fd5edf9efbccecbb3 100644 (file)
@@ -111,12 +111,17 @@ _require_getnextquota()
 # prior to mount.  This is a relatively new feature ...
 _scratch_enable_pquota()
 {
-       [[ "$FSTYP" != ext[234] ]] && return
-
-       tune2fs -O quota,project $SCRATCH_DEV >>$seqres.full 2>&1
-       _try_scratch_mount >/dev/null 2>&1 \
-               || _notrun "kernel doesn't support project feature on $FSTYP"
-       _scratch_unmount
+       case $FSTYP in
+       ext2|ext3|ext4)
+               tune2fs -O quota,project $SCRATCH_DEV >>$seqres.full 2>&1
+               _try_scratch_mount >/dev/null 2>&1 \
+                       || _notrun "kernel doesn't support project feature on $FSTYP"
+               _scratch_unmount
+               ;;
+       f2fs)
+               _scratch_mkfs "-O extra_attr -O quota -O project_quota" >> $seqres.full 2>&1
+               ;;
+       esac
 }
 
 #