Skip to contentSkip to conversation

generic: test statfs on project quota directory

PATCH New Zorro Lang 1 participant 1 message Apr 11, 2019

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 generic: test statfs on project quota directory

There's a bug on xfs cause statfs get negative f_ffree value from a project quota directory. It's fixed by "de7243057 fs/xfs: fix f_ffree value for statfs when project quota is set". So add statfs testing on project quota block and inode count limit.

For testing foreign fs quota, change _qmount() function, turn on project if quotaon support.

---

Hi,

There's one thing I don't understand, so CC ext4 mail list. Please feel free to reply, if anyone knows that:

$ mkfs.ext4 $SCRATCH_DEV
$ tune2fs -O quota,project $SCRATCH_DEV
$ mount $SCRATCH_DEV $SCRATCH_MNT -o prjquota
$ quotaon -P $SCRATCH_MNT
$ mkdir $SCRATCH_MNT/t
$ xfs_quota -f -x -c "project -p $SCRATCH_MNT/t -s 42" $SCRATCH_MNT
$ xfs_quota -f -x -c "limit -p bsoft=100m answer" $SCRATCH_MNT
$ df -k $SCRATCH_MNT/t
Filesystem    1K-blocks  Used Available Use% Mounted on
SCRATCH_DEV    102400     4    102396   1% SCRATCH_MNT

On XFS, the 'Used' field always shows '0'. But why ext4 always has more 4k? Is it a bug or expected.

Thanks,
Zorro

 common/quota          |  4 +++
 tests/generic/999     | 74 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/999.out |  3 ++
 tests/generic/group   |  1 +
 4 files changed, 82 insertions(+)
 create mode 100755 tests/generic/999
 create mode 100644 tests/generic/999.out
common/quota +4 -0
index f19f81a1..315df8cb 100644
@@ -200,6 +200,10 @@ _qmount()
     if [ "$FSTYP" != "xfs" ]; then
         quotacheck -ug $SCRATCH_MNT >>$seqres.full 2>&1
         quotaon -ug $SCRATCH_MNT >>$seqres.full 2>&1
+	# try to turn on project quota if it's supported
+	if quotaon --help 2>&1 | grep -q '\-\-project'; then
+		quotaon --project $SCRATCH_MNT >>$seqres.full 2>&1
+	fi
     fi
     chmod ugo+rwx $SCRATCH_MNT
 }
tests/generic/999 new file +74 -0

74 lines not on this page · raw message

tests/generic/999.out new file +3 -0
new file mode 100644
index 00000000..1bebabd4
@@ -0,0 +1,3 @@
+QA output created by 999
+File Inodes IUsed 1K-blocks Used
+SCRATCH_MNT/t 53 2 102400 N
tests/generic/group +1 -0
index 9f4845c6..35da10a5 100644
@@ -542,3 +542,4 @@
 537 auto quick trim
 538 auto quick aio
 539 auto quick punch seek
+999 auto quick quota
Signature · 1 line
2.17.2