Skip to contentSkip to conversation

xfs: project quota ineritance flag test

PATCH In review Zorro Lang 3 participants 5 messages Jun 19, 2019 – Jul 12, 2019

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 xfs: project quota ineritance flag test

This case is used to cover xfsprogs bug "b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set" at first. Then test more behavior when project ineritance flag is set or removed.

---
 tests/xfs/507     | 117 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/507.out |  23 +++++++++
 tests/xfs/group   |   1 +
 3 files changed, 141 insertions(+)
 create mode 100755 tests/xfs/507
 create mode 100644 tests/xfs/507.out
tests/xfs/507 new file +117 -0
new file mode 100755
index 00000000..509da03e
@@ -0,0 +1,117 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2019 Red Hat, Inc.  All Rights Reserved.
+#
+# FS QA Test 507
+#
+# Test project quota inheritance flag, uncover xfsprogs:
+#    b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+_require_xfs_quota
+
+cat >$tmp.projects <<EOF
+10:$SCRATCH_MNT/dir
+EOF
+
+cat >$tmp.projid <<EOF
+root:0
+test:10
+EOF
+
+QUOTA_CMD="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
+
+filter_xfs_pquota()
+{
+        perl -ne "
+s,$tmp.projects,[PROJECTS_FILE],;
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+        print;"
+}
+
+do_quota_nospc()
+{
+	local file=$1
+	local exp=$2
+
+	echo "Write $file, expect $exp:" | _filter_scratch
+
+	# replace the "pwrite64" which old xfs_io prints
+	$XFS_IO_PROG -t -f -c "pwrite 0 5m" $file 2>&1 >/dev/null | \
+		sed -e 's/pwrite64/pwrite/g'
+	rm -f $file
+}
+
+_scratch_mkfs_xfs >>$seqres.full 2>&1
+_qmount_option "prjquota"
+_qmount
+_require_prjquota $SCRATCH_DEV
+
+mkdir $SCRATCH_MNT/dir
+$QUOTA_CMD -x -c 'project -s test' $SCRATCH_MNT >>$seqres.full 2>&1
+$QUOTA_CMD -x -c 'limit -p bsoft=1m bhard=2m test' $SCRATCH_MNT
+
+# test the Project inheritance bit is a directory only flag, and it's set on
+# directory by default
+echo "== The parent directory has Project inheritance bit by default =="
+touch $SCRATCH_MNT/dir/foo
+mkdir $SCRATCH_MNT/dir/dir_inherit
+touch $SCRATCH_MNT/dir/dir_inherit/foo
+$QUOTA_CMD -x -c 'project -c test' $SCRATCH_MNT | filter_xfs_pquota
+echo ""
+
+# test the quota and the project inheritance quota work well
+do_quota_nospc $SCRATCH_MNT/dir/foo ENOSPC
+do_quota_nospc $SCRATCH_MNT/dir/dir_inherit/foo ENOSPC
+echo ""
+
+# test the project quota won't be inherited, if removing the Project
+# inheritance bit
+echo "== After removing parent directory has Project inheritance bit =="
+$XFS_IO_PROG -x -c "chattr -P" $SCRATCH_MNT/dir
+touch $SCRATCH_MNT/dir/foo
+mkdir $SCRATCH_MNT/dir/dir_uninherit
+touch $SCRATCH_MNT/dir/dir_uninherit/foo
+$QUOTA_CMD -x -c 'project -c test' $SCRATCH_MNT | filter_xfs_pquota
+echo ""
+
+# after remove the Project inheritance bit of the original parent directory,
+# then verify:
+# 1) there's not any limit on the original parent directory and files under it
+# 2) the quota limit of sub-directory which has inherited still works
+# 3) there's not limit on the new sub-dirctory (not inherit from parent)
+do_quota_nospc $SCRATCH_MNT/dir/foo Success
+do_quota_nospc $SCRATCH_MNT/dir/dir_inherit/foo ENOSPC
+do_quota_nospc $SCRATCH_MNT/dir/dir_uninherit/foo Success
+
+_scratch_unmount
+# success, all done
+status=0
+exit
tests/xfs/507.out new file +23 -0
new file mode 100644
index 00000000..c8c09d3f
@@ -0,0 +1,23 @@
+QA output created by 507
+== The parent directory has Project inheritance bit by default ==
+Checking project test (path [SCR_MNT]/dir)...
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+
+== After removing parent directory has Project inheritance bit ==
+Checking project test (path [SCR_MNT]/dir)...
+[SCR_MNT]/dir - project inheritance flag is not set
+[SCR_MNT]/dir/foo - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project inheritance flag is not set
+[SCR_MNT]/dir/dir_uninherit/foo - project identifier is not set (inode=0, tree=10)
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect Success:
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:
tests/xfs/group +1 -0
index ffe4ae12..46200752 100644
@@ -504,3 +504,4 @@
 504 auto quick mkfs label
 505 auto quick spaceman
 506 auto quick health
+507 auto quick quota
Signature · 1 line
2.17.2
#1 lore raw
Quoted 6 lines · Zorro Lang

This case is used to cover xfsprogs bug "b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set" at first. Then test more behavior when project ineritance flag is set or removed.

Test looks fine to me. Just some minor issues inline, and I've fixed them up on commit.

Quoted 14 lines
---
 tests/xfs/507     | 117 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/507.out |  23 +++++++++
 tests/xfs/group   |   1 +
 3 files changed, 141 insertions(+)
 create mode 100755 tests/xfs/507
 create mode 100644 tests/xfs/507.out
tests/xfs/507 new file +0 -0
new file mode 100755
index 00000000..509da03e

tests/xfs/507 line 8

Quoted 8 lines
tests/xfs/507 new file +8 -0
@@ -0,0 +1,117 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2019 Red Hat, Inc.  All Rights Reserved.
+#
+# FS QA Test 507
+#
+# Test project quota inheritance flag, uncover xfsprogs:
+#    b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set

Test project..., uncover xfsprogs bug fixed by commit b136f48b19a5 ("xfs_quota: fix false error reporting of project inheritance flag is not set").

Quoted 50 lines
tests/xfs/507 new file +50 -0
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+	cd /
+	rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+. ./common/quota
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+_supported_fs xfs
+_supported_os Linux
+_require_scratch
+_require_xfs_quota
+
+cat >$tmp.projects <<EOF
+10:$SCRATCH_MNT/dir
+EOF
+
+cat >$tmp.projid <<EOF
+root:0
+test:10
+EOF
+
+QUOTA_CMD="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
+
+filter_xfs_pquota()
+{
+        perl -ne "
+s,$tmp.projects,[PROJECTS_FILE],;
+s,$SCRATCH_MNT,[SCR_MNT],;
+s,$SCRATCH_DEV,[SCR_DEV],;
+        print;"
+}
+

tests/xfs/507 line 68

Quoted 10 lines
tests/xfs/507 new file +10 -0
+do_quota_nospc()
+{
+	local file=$1
+	local exp=$2
+
+	echo "Write $file, expect $exp:" | _filter_scratch
+
+	# replace the "pwrite64" which old xfs_io prints
+	$XFS_IO_PROG -t -f -c "pwrite 0 5m" $file 2>&1 >/dev/null | \
+		sed -e 's/pwrite64/pwrite/g'

_filter_xfs_io_error does this job.

Quoted 4 lines
tests/xfs/507 new file +4 -0
+	rm -f $file
+}
+
+_scratch_mkfs_xfs >>$seqres.full 2>&1

tests/xfs/507 line 82

Quoted 10 lines
tests/xfs/507 new file +10 -0
+_qmount_option "prjquota"
+_qmount
+_require_prjquota $SCRATCH_DEV
+
+mkdir $SCRATCH_MNT/dir
+$QUOTA_CMD -x -c 'project -s test' $SCRATCH_MNT >>$seqres.full 2>&1
+$QUOTA_CMD -x -c 'limit -p bsoft=1m bhard=2m test' $SCRATCH_MNT
+
+# test the Project inheritance bit is a directory only flag, and it's set on
+# directory by default

I added comments here to state that we don't expect "project inheritance flag is not set" from xfs_quota.

Thanks,
Eryu

Quoted 76 lines
tests/xfs/507 new file +35 -0
+echo "== The parent directory has Project inheritance bit by default =="
+touch $SCRATCH_MNT/dir/foo
+mkdir $SCRATCH_MNT/dir/dir_inherit
+touch $SCRATCH_MNT/dir/dir_inherit/foo
+$QUOTA_CMD -x -c 'project -c test' $SCRATCH_MNT | filter_xfs_pquota
+echo ""
+
+# test the quota and the project inheritance quota work well
+do_quota_nospc $SCRATCH_MNT/dir/foo ENOSPC
+do_quota_nospc $SCRATCH_MNT/dir/dir_inherit/foo ENOSPC
+echo ""
+
+# test the project quota won't be inherited, if removing the Project
+# inheritance bit
+echo "== After removing parent directory has Project inheritance bit =="
+$XFS_IO_PROG -x -c "chattr -P" $SCRATCH_MNT/dir
+touch $SCRATCH_MNT/dir/foo
+mkdir $SCRATCH_MNT/dir/dir_uninherit
+touch $SCRATCH_MNT/dir/dir_uninherit/foo
+$QUOTA_CMD -x -c 'project -c test' $SCRATCH_MNT | filter_xfs_pquota
+echo ""
+
+# after remove the Project inheritance bit of the original parent directory,
+# then verify:
+# 1) there's not any limit on the original parent directory and files under it
+# 2) the quota limit of sub-directory which has inherited still works
+# 3) there's not limit on the new sub-dirctory (not inherit from parent)
+do_quota_nospc $SCRATCH_MNT/dir/foo Success
+do_quota_nospc $SCRATCH_MNT/dir/dir_inherit/foo ENOSPC
+do_quota_nospc $SCRATCH_MNT/dir/dir_uninherit/foo Success
+
+_scratch_unmount
+# success, all done
+status=0
+exit
tests/xfs/507.out new file +23 -0
new file mode 100644
index 00000000..c8c09d3f
@@ -0,0 +1,23 @@
+QA output created by 507
+== The parent directory has Project inheritance bit by default ==
+Checking project test (path [SCR_MNT]/dir)...
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+
+== After removing parent directory has Project inheritance bit ==
+Checking project test (path [SCR_MNT]/dir)...
+[SCR_MNT]/dir - project inheritance flag is not set
+[SCR_MNT]/dir/foo - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project inheritance flag is not set
+[SCR_MNT]/dir/dir_uninherit/foo - project identifier is not set (inode=0, tree=10)
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect Success:
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:
tests/xfs/group +1 -0
index ffe4ae12..46200752 100644
@@ -504,3 +504,4 @@
 504 auto quick mkfs label
 505 auto quick spaceman
 506 auto quick health
+507 auto quick quota
Signature · 1 line
2.17.2
#2 lore raw
In reply to Zorro Lang
Quoted 7 lines · Zorro Lang

This case is used to cover xfsprogs bug "b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set" at first. Then test more behavior when project ineritance flag is set or removed.

---

<skipping to the good part>

Quoted 18 lines
tests/xfs/507.out new file +12 -0
new file mode 100644
index 00000000..c8c09d3f
@@ -0,0 +1,23 @@
+QA output created by 507
+== The parent directory has Project inheritance bit by default ==
+Checking project test (path [SCR_MNT]/dir)...
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+
+== After removing parent directory has Project inheritance bit ==
+Checking project test (path [SCR_MNT]/dir)...

tests/xfs/507.out line 22

Quoted 10 lines
tests/xfs/507.out new file +10 -0
+[SCR_MNT]/dir - project inheritance flag is not set
+[SCR_MNT]/dir/foo - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project inheritance flag is not set
+[SCR_MNT]/dir/dir_uninherit/foo - project identifier is not set (inode=0, tree=10)
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect Success:
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device

I keep seeing this test failure:

xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 renamed from xfs/508.out 2019-06-30 08:32:32.216174715 -0700 +1 -1
@@ -19,5 +19,5 @@
 
 Write SCRATCH_MNT/dir/foo, expect Success:
 Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
-pwrite: No space left on device
+/opt/dir/dir_inherit/foo: Disk quota exceeded
 Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:

IIRC EDQUOT is the correct error code for running out of /project/ quota (and I tried with a modern V5 fs and a V4 fs too) both with setting no quota options at all and turning on every quota type supported by the fs.

Under what circumstances does xfs_io spit out ENOSPC?

--D

Quoted 13 lines
tests/xfs/507.out new file +1 -0
+Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:
tests/xfs/group +1 -0
index ffe4ae12..46200752 100644
@@ -504,3 +504,4 @@
 504 auto quick mkfs label
 505 auto quick spaceman
 506 auto quick health
+507 auto quick quota
Signature · 1 line
2.17.2
author
#3 lore raw
Quoted 45 lines · Darrick J. Wong
Quoted 7 lines · Zorro Lang

This case is used to cover xfsprogs bug "b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set" at first. Then test more behavior when project ineritance flag is set or removed.

---

<skipping to the good part>

Quoted 18 lines
tests/xfs/507.out new file +12 -0
new file mode 100644
index 00000000..c8c09d3f
@@ -0,0 +1,23 @@
+QA output created by 507
+== The parent directory has Project inheritance bit by default ==
+Checking project test (path [SCR_MNT]/dir)...
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+
+== After removing parent directory has Project inheritance bit ==
+Checking project test (path [SCR_MNT]/dir)...

tests/xfs/507.out line 22

Quoted 10 lines
tests/xfs/507.out new file +10 -0
+[SCR_MNT]/dir - project inheritance flag is not set
+[SCR_MNT]/dir/foo - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project inheritance flag is not set
+[SCR_MNT]/dir/dir_uninherit/foo - project identifier is not set (inode=0, tree=10)
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect Success:
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device

I keep seeing this test failure:

xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 line 22

Quoted 5 lines
xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 renamed from xfs/508.out 2019-06-30 08:32:32.216174715 -0700 +1 -1
@@ -19,5 +19,5 @@
 
 Write SCRATCH_MNT/dir/foo, expect Success:
 Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
-pwrite: No space left on device
+/opt/dir/dir_inherit/foo: Disk quota exceeded

Hmm... I never saw this issue. I tested on RHEL-7, RHEL-8.0 and latest upstream xfsprogs & xfs-linux, all passed.

Quoted 8 lines
xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 renamed from xfs/508.out 2019-06-30 08:32:32.216174715 -0700 +0 -0
 Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:

IIRC EDQUOT is the correct error code for running out of /project/ quota (and I tried with a modern V5 fs and a V4 fs too) both with setting no quota options at all and turning on every quota type supported by the fs.

Under what circumstances does xfs_io spit out ENOSPC?

I didn't test with any special test arguments, all as default. For example, as
below test on
xfsprogs: HEAD: 8bfb5eac (HEAD -> for-next, origin/for-next) xfs_quota: fix built-in help for project setup
xfs-linux: HEAD: 036f463fe15d (HEAD -> for-next, tag: xfs-5.3-merge-10, origin/xfs-5.3-merge, origin/for-next) xfs: online scrub needn't bother zeroing its temporary buffer

# ./check xfs/508
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 xxx-xxxxxx-xxx 5.2.0-rc4-xfs-for-next
MKFS_OPTIONS  -- -f -bsize=4096 /dev/mapper/xfscratch
MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/mapper/xfscratch /mnt/scratch

xfs/508 5s ... 5s
Ran: xfs/508
Passed all 1 tests

# xfs_io -V
xfs_io version 5.1.0-rc0
# xfs_info /dev/mapper/xfscratch
meta-data=/dev/mapper/xfscratch isize=512    agcount=4, agsize=5570560 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=22282240, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=10880, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Do you need me to provide anything else?

Thanks,
Zorro

Quoted 16 lines

--D

Quoted 13 lines
tests/xfs/507.out new file +1 -0
+Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:
tests/xfs/group +1 -0
index ffe4ae12..46200752 100644
@@ -504,3 +504,4 @@
 504 auto quick mkfs label
 505 auto quick spaceman
 506 auto quick health
+507 auto quick quota
Signature · 1 line
2.17.2
#4 lore raw
Quoted 94 lines · Zorro Lang
Quoted 45 lines · Darrick J. Wong
Quoted 7 lines · Zorro Lang

This case is used to cover xfsprogs bug "b136f48b xfs_quota: fix false error reporting of project inheritance flag is not set" at first. Then test more behavior when project ineritance flag is set or removed.

---

<skipping to the good part>

Quoted 18 lines
tests/xfs/507.out new file +12 -0
new file mode 100644
index 00000000..c8c09d3f
@@ -0,0 +1,23 @@
+QA output created by 507
+== The parent directory has Project inheritance bit by default ==
+Checking project test (path [SCR_MNT]/dir)...
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect ENOSPC:
+pwrite: No space left on device
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device
+
+== After removing parent directory has Project inheritance bit ==
+Checking project test (path [SCR_MNT]/dir)...

tests/xfs/507.out line 22

Quoted 10 lines
tests/xfs/507.out new file +10 -0
+[SCR_MNT]/dir - project inheritance flag is not set
+[SCR_MNT]/dir/foo - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project identifier is not set (inode=0, tree=10)
+[SCR_MNT]/dir/dir_uninherit - project inheritance flag is not set
+[SCR_MNT]/dir/dir_uninherit/foo - project identifier is not set (inode=0, tree=10)
+Processed 1 ([PROJECTS_FILE] and cmdline) paths for project test with recursion depth infinite (-1).
+
+Write SCRATCH_MNT/dir/foo, expect Success:
+Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
+pwrite: No space left on device

I keep seeing this test failure:

xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 line 22

Quoted 5 lines
xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 renamed from xfs/508.out 2019-06-30 08:32:32.216174715 -0700 +1 -1
@@ -19,5 +19,5 @@
 
 Write SCRATCH_MNT/dir/foo, expect Success:
 Write SCRATCH_MNT/dir/dir_inherit/foo, expect ENOSPC:
-pwrite: No space left on device
+/opt/dir/dir_inherit/foo: Disk quota exceeded

Hmm... I never saw this issue. I tested on RHEL-7, RHEL-8.0 and latest upstream xfsprogs & xfs-linux, all passed.

Quoted 8 lines
xfs/508.out.bad 2019-07-11 07:32:30.488000000 -0700 renamed from xfs/508.out 2019-06-30 08:32:32.216174715 -0700 +0 -0
 Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:

IIRC EDQUOT is the correct error code for running out of /project/ quota (and I tried with a modern V5 fs and a V4 fs too) both with setting no quota options at all and turning on every quota type supported by the fs.

Under what circumstances does xfs_io spit out ENOSPC?

I didn't test with any special test arguments, all as default. For example, as
below test on
xfsprogs: HEAD: 8bfb5eac (HEAD -> for-next, origin/for-next) xfs_quota: fix built-in help for project setup
xfs-linux: HEAD: 036f463fe15d (HEAD -> for-next, tag: xfs-5.3-merge-10, origin/xfs-5.3-merge, origin/for-next) xfs: online scrub needn't bother zeroing its temporary buffer

# ./check xfs/508
FSTYP         -- xfs (debug)
PLATFORM      -- Linux/x86_64 xxx-xxxxxx-xxx 5.2.0-rc4-xfs-for-next
MKFS_OPTIONS  -- -f -bsize=4096 /dev/mapper/xfscratch
MOUNT_OPTIONS -- -o context=system_u:object_r:root_t:s0 /dev/mapper/xfscratch /mnt/scratch

xfs/508 5s ... 5s
Ran: xfs/508
Passed all 1 tests

# xfs_io -V
xfs_io version 5.1.0-rc0
# xfs_info /dev/mapper/xfscratch
meta-data=/dev/mapper/xfscratch isize=512    agcount=4, agsize=5570560 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=1, sparse=1, rmapbt=0
         =                       reflink=1
data     =                       bsize=4096   blocks=22282240, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
log      =internal log           bsize=4096   blocks=10880, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
Quoted 1 line

Do you need me to provide anything else?

HAH. Oops. I was testing my dev tree, not upstream, so clearly there's a bug in there somewhere. Uh, good test! :)

Sorry for the noise.

--D

Quoted 19 lines

Thanks,
Zorro

Quoted 16 lines

--D

Quoted 13 lines
tests/xfs/507.out new file +1 -0
+Write SCRATCH_MNT/dir/dir_uninherit/foo, expect Success:
tests/xfs/group +1 -0
index ffe4ae12..46200752 100644
@@ -504,3 +504,4 @@
 504 auto quick mkfs label
 505 auto quick spaceman
 506 auto quick health
+507 auto quick quota
Signature · 1 line
2.17.2