* [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
@ 2016-04-01 7:00 ` Eryu Guan
0 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2016-04-01 7:00 UTC (permalink / raw)
To: fstests; +Cc: Eryu Guan, xfs
With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
xfs/133 fails as
Filesystem Blocks Quota Limit Warn/Time Mounted on
SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
=== report command output ===
+(null) 0 0 0 00 [--------]
123456-project 0 102400 204800 00 [--------]
Fix it by limiting xfs_quota to report on specific project quota number
using -L & -U option, so only the project quota being tested is
reported.
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
I'm not sure if kernel should be fixed, but limiting the quota report on
project number being tested seems something worth doing to me anyway. It avoids
breakage of future changes of quota report output.
tests/xfs/133 | 8 +++++---
tests/xfs/133.out | 2 +-
tests/xfs/134 | 22 +++++++++++++++-------
tests/xfs/262 | 6 ++++--
4 files changed, 25 insertions(+), 13 deletions(-)
diff --git a/tests/xfs/133 b/tests/xfs/133
index 82c38b1..7a0e55e 100755
--- a/tests/xfs/133
+++ b/tests/xfs/133
@@ -57,16 +57,17 @@ do_project_test()
{
local qa_project=123456-project
local dir=$SCRATCH_MNT/project
+ local proj_num=10
mkdir $dir 2>/dev/null
#project quota files
cat >$tmp.projects <<EOF
-10:$dir
+$proj_num:$dir
EOF
cat >$tmp.projid <<EOF
-$qa_project:10
+$qa_project:$proj_num
EOF
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
@@ -81,7 +82,8 @@ EOF
echo "=== report command output ==="
$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
- -c "report -p -N -b" $SCRATCH_MNT | _filter_quota
+ -c "report -p -N -b -L $proj_num -U $proj_num" \
+ $SCRATCH_MNT | _filter_quota
}
# Test project
diff --git a/tests/xfs/133.out b/tests/xfs/133.out
index 21cfd0d..8c747bf 100644
--- a/tests/xfs/133.out
+++ b/tests/xfs/133.out
@@ -4,5 +4,5 @@ Disk quotas for Project 123456-project (10)
Filesystem Blocks Quota Limit Warn/Time Mounted on
SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
=== report command output ===
-123456-project 0 102400 204800 00 [--------]
+#10 0 102400 204800 00 [--------]
diff --git a/tests/xfs/134 b/tests/xfs/134
index be18ee8..5ba275c 100755
--- a/tests/xfs/134
+++ b/tests/xfs/134
@@ -54,12 +54,13 @@ _require_xfs_quota
dir=$SCRATCH_MNT/project
#project quota files
+proj_num=1
cat >$tmp.projects <<EOF
-1:$dir
+$proj_num:$dir
EOF
cat >$tmp.projid <<EOF
-test:1
+test:$proj_num
EOF
cp /dev/null $seqres.full
@@ -87,17 +88,24 @@ fi
src/feature -p $SCRATCH_DEV
[ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
+report_quota()
+{
+ $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
+ -c "repquota -inN -p -L $proj_num -U $proj_num" $SCRATCH_DEV | \
+ tr -s '[:space:]'
+}
+
mkdir $dir
$XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
-xfs_quota -D $tmp.projects -P $tmp.projid -x \
+$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
-c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
touch $dir/1
touch $dir/2
cp $dir/2 $dir/3
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
if [ "$HOSTOS" == "IRIX" ] ; then
mkfile 1M $TEST_DIR/6
@@ -107,12 +115,12 @@ fi
#try cp to dir
cp $TEST_DIR/6 $dir/6
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
#try mv to dir
mv $TEST_DIR/6 $dir/7
-xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
+report_quota
# success, all done
status=0
diff --git a/tests/xfs/262 b/tests/xfs/262
index 9d8b838..d3a352c 100755
--- a/tests/xfs/262
+++ b/tests/xfs/262
@@ -138,11 +138,13 @@ _quota_cmd "limit -p bhard=${qlimit_meg}m bsoft=${qlimit_meg}m ${proj_name}" \
2>> "$seqres.full" 1>&2
# See what gets reported
-_quota_cmd "report" | _filter_quota_rpt 2>> "$seqres.full"
+_quota_cmd "report -U $proj_num -L $proj_num" | _filter_quota_rpt \
+ 2>> $seqres.full
_quota_cmd "df" | _filter_quota_rpt 2>> "$seqres.full"
# This time using "human readable" output
-_quota_cmd "report -h" | _filter_quota_rpt 2>> "$seqres.full"
+_quota_cmd "report -h $proj_num -L $proj_num" | _filter_quota_rpt \
+ 2>> "$seqres.full"
_quota_cmd "df -h" | _filter_quota_rpt 2>> "$seqres.full"
# Clean up
--
2.5.5
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
2016-04-01 7:00 ` Eryu Guan
@ 2016-04-01 7:28 ` Zorro Lang
-1 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2016-04-01 7:28 UTC (permalink / raw)
To: Eryu Guan; +Cc: fstests, xfs, sandeen
On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
> xfs/133 fails as
>
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> === report command output ===
> +(null) 0 0 0 00 [--------]
> 123456-project 0 102400 204800 00 [--------]
>
> Fix it by limiting xfs_quota to report on specific project quota number
> using -L & -U option, so only the project quota being tested is
> reported.
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>
> I'm not sure if kernel should be fixed, but limiting the quota report on
> project number being tested seems something worth doing to me anyway. It avoids
> breakage of future changes of quota report output.
Hi,
FYI:
About "+(null) 0 0 0 00 [--------]"problem, it has been talked in:
http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968
I think:
1) If we consider that this's a bug, the original test cases can
be the reproducer of this bug, so we shouldn't change the cases.
2) If we think print "(null) 0 0 0 00 [--------]" is right(or not
wrong), then this patch is good.
Thanks,
Zorro
>
> tests/xfs/133 | 8 +++++---
> tests/xfs/133.out | 2 +-
> tests/xfs/134 | 22 +++++++++++++++-------
> tests/xfs/262 | 6 ++++--
> 4 files changed, 25 insertions(+), 13 deletions(-)
>
> diff --git a/tests/xfs/133 b/tests/xfs/133
> index 82c38b1..7a0e55e 100755
> --- a/tests/xfs/133
> +++ b/tests/xfs/133
> @@ -57,16 +57,17 @@ do_project_test()
> {
> local qa_project=123456-project
> local dir=$SCRATCH_MNT/project
> + local proj_num=10
>
> mkdir $dir 2>/dev/null
>
> #project quota files
> cat >$tmp.projects <<EOF
> -10:$dir
> +$proj_num:$dir
> EOF
>
> cat >$tmp.projid <<EOF
> -$qa_project:10
> +$qa_project:$proj_num
> EOF
>
> $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> @@ -81,7 +82,8 @@ EOF
>
> echo "=== report command output ==="
> $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> - -c "report -p -N -b" $SCRATCH_MNT | _filter_quota
> + -c "report -p -N -b -L $proj_num -U $proj_num" \
> + $SCRATCH_MNT | _filter_quota
> }
>
> # Test project
> diff --git a/tests/xfs/133.out b/tests/xfs/133.out
> index 21cfd0d..8c747bf 100644
> --- a/tests/xfs/133.out
> +++ b/tests/xfs/133.out
> @@ -4,5 +4,5 @@ Disk quotas for Project 123456-project (10)
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> === report command output ===
> -123456-project 0 102400 204800 00 [--------]
> +#10 0 102400 204800 00 [--------]
>
> diff --git a/tests/xfs/134 b/tests/xfs/134
> index be18ee8..5ba275c 100755
> --- a/tests/xfs/134
> +++ b/tests/xfs/134
> @@ -54,12 +54,13 @@ _require_xfs_quota
> dir=$SCRATCH_MNT/project
>
> #project quota files
> +proj_num=1
> cat >$tmp.projects <<EOF
> -1:$dir
> +$proj_num:$dir
> EOF
>
> cat >$tmp.projid <<EOF
> -test:1
> +test:$proj_num
> EOF
>
> cp /dev/null $seqres.full
> @@ -87,17 +88,24 @@ fi
> src/feature -p $SCRATCH_DEV
> [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
>
> +report_quota()
> +{
> + $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> + -c "repquota -inN -p -L $proj_num -U $proj_num" $SCRATCH_DEV | \
> + tr -s '[:space:]'
> +}
> +
> mkdir $dir
> $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x \
> +$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
> touch $dir/1
> touch $dir/2
> cp $dir/2 $dir/3
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> if [ "$HOSTOS" == "IRIX" ] ; then
> mkfile 1M $TEST_DIR/6
> @@ -107,12 +115,12 @@ fi
>
> #try cp to dir
> cp $TEST_DIR/6 $dir/6
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> #try mv to dir
> mv $TEST_DIR/6 $dir/7
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> # success, all done
> status=0
> diff --git a/tests/xfs/262 b/tests/xfs/262
> index 9d8b838..d3a352c 100755
> --- a/tests/xfs/262
> +++ b/tests/xfs/262
> @@ -138,11 +138,13 @@ _quota_cmd "limit -p bhard=${qlimit_meg}m bsoft=${qlimit_meg}m ${proj_name}" \
> 2>> "$seqres.full" 1>&2
>
> # See what gets reported
> -_quota_cmd "report" | _filter_quota_rpt 2>> "$seqres.full"
> +_quota_cmd "report -U $proj_num -L $proj_num" | _filter_quota_rpt \
> + 2>> $seqres.full
> _quota_cmd "df" | _filter_quota_rpt 2>> "$seqres.full"
>
> # This time using "human readable" output
> -_quota_cmd "report -h" | _filter_quota_rpt 2>> "$seqres.full"
> +_quota_cmd "report -h $proj_num -L $proj_num" | _filter_quota_rpt \
> + 2>> "$seqres.full"
> _quota_cmd "df -h" | _filter_quota_rpt 2>> "$seqres.full"
>
> # Clean up
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
@ 2016-04-01 7:28 ` Zorro Lang
0 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2016-04-01 7:28 UTC (permalink / raw)
To: Eryu Guan; +Cc: sandeen, fstests, xfs
On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
> xfs/133 fails as
>
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> === report command output ===
> +(null) 0 0 0 00 [--------]
> 123456-project 0 102400 204800 00 [--------]
>
> Fix it by limiting xfs_quota to report on specific project quota number
> using -L & -U option, so only the project quota being tested is
> reported.
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>
> I'm not sure if kernel should be fixed, but limiting the quota report on
> project number being tested seems something worth doing to me anyway. It avoids
> breakage of future changes of quota report output.
Hi,
FYI:
About "+(null) 0 0 0 00 [--------]"problem, it has been talked in:
http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968
I think:
1) If we consider that this's a bug, the original test cases can
be the reproducer of this bug, so we shouldn't change the cases.
2) If we think print "(null) 0 0 0 00 [--------]" is right(or not
wrong), then this patch is good.
Thanks,
Zorro
>
> tests/xfs/133 | 8 +++++---
> tests/xfs/133.out | 2 +-
> tests/xfs/134 | 22 +++++++++++++++-------
> tests/xfs/262 | 6 ++++--
> 4 files changed, 25 insertions(+), 13 deletions(-)
>
> diff --git a/tests/xfs/133 b/tests/xfs/133
> index 82c38b1..7a0e55e 100755
> --- a/tests/xfs/133
> +++ b/tests/xfs/133
> @@ -57,16 +57,17 @@ do_project_test()
> {
> local qa_project=123456-project
> local dir=$SCRATCH_MNT/project
> + local proj_num=10
>
> mkdir $dir 2>/dev/null
>
> #project quota files
> cat >$tmp.projects <<EOF
> -10:$dir
> +$proj_num:$dir
> EOF
>
> cat >$tmp.projid <<EOF
> -$qa_project:10
> +$qa_project:$proj_num
> EOF
>
> $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> @@ -81,7 +82,8 @@ EOF
>
> echo "=== report command output ==="
> $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> - -c "report -p -N -b" $SCRATCH_MNT | _filter_quota
> + -c "report -p -N -b -L $proj_num -U $proj_num" \
> + $SCRATCH_MNT | _filter_quota
> }
>
> # Test project
> diff --git a/tests/xfs/133.out b/tests/xfs/133.out
> index 21cfd0d..8c747bf 100644
> --- a/tests/xfs/133.out
> +++ b/tests/xfs/133.out
> @@ -4,5 +4,5 @@ Disk quotas for Project 123456-project (10)
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> === report command output ===
> -123456-project 0 102400 204800 00 [--------]
> +#10 0 102400 204800 00 [--------]
>
> diff --git a/tests/xfs/134 b/tests/xfs/134
> index be18ee8..5ba275c 100755
> --- a/tests/xfs/134
> +++ b/tests/xfs/134
> @@ -54,12 +54,13 @@ _require_xfs_quota
> dir=$SCRATCH_MNT/project
>
> #project quota files
> +proj_num=1
> cat >$tmp.projects <<EOF
> -1:$dir
> +$proj_num:$dir
> EOF
>
> cat >$tmp.projid <<EOF
> -test:1
> +test:$proj_num
> EOF
>
> cp /dev/null $seqres.full
> @@ -87,17 +88,24 @@ fi
> src/feature -p $SCRATCH_DEV
> [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
>
> +report_quota()
> +{
> + $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> + -c "repquota -inN -p -L $proj_num -U $proj_num" $SCRATCH_DEV | \
> + tr -s '[:space:]'
> +}
> +
> mkdir $dir
> $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x \
> +$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
> touch $dir/1
> touch $dir/2
> cp $dir/2 $dir/3
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> if [ "$HOSTOS" == "IRIX" ] ; then
> mkfile 1M $TEST_DIR/6
> @@ -107,12 +115,12 @@ fi
>
> #try cp to dir
> cp $TEST_DIR/6 $dir/6
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> #try mv to dir
> mv $TEST_DIR/6 $dir/7
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> # success, all done
> status=0
> diff --git a/tests/xfs/262 b/tests/xfs/262
> index 9d8b838..d3a352c 100755
> --- a/tests/xfs/262
> +++ b/tests/xfs/262
> @@ -138,11 +138,13 @@ _quota_cmd "limit -p bhard=${qlimit_meg}m bsoft=${qlimit_meg}m ${proj_name}" \
> 2>> "$seqres.full" 1>&2
>
> # See what gets reported
> -_quota_cmd "report" | _filter_quota_rpt 2>> "$seqres.full"
> +_quota_cmd "report -U $proj_num -L $proj_num" | _filter_quota_rpt \
> + 2>> $seqres.full
> _quota_cmd "df" | _filter_quota_rpt 2>> "$seqres.full"
>
> # This time using "human readable" output
> -_quota_cmd "report -h" | _filter_quota_rpt 2>> "$seqres.full"
> +_quota_cmd "report -h $proj_num -L $proj_num" | _filter_quota_rpt \
> + 2>> "$seqres.full"
> _quota_cmd "df -h" | _filter_quota_rpt 2>> "$seqres.full"
>
> # Clean up
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
2016-04-01 7:28 ` Zorro Lang
@ 2016-04-01 17:24 ` Eric Sandeen
-1 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2016-04-01 17:24 UTC (permalink / raw)
To: Zorro Lang, Eryu Guan; +Cc: fstests, xfs, sandeen
On 4/1/16 2:28 AM, Zorro Lang wrote:
> On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
>> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
>> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
>> xfs/133 fails as
>>
>> Filesystem Blocks Quota Limit Warn/Time Mounted on
>> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
>> === report command output ===
>> +(null) 0 0 0 00 [--------]
>> 123456-project 0 102400 204800 00 [--------]
>>
>> Fix it by limiting xfs_quota to report on specific project quota number
>> using -L & -U option, so only the project quota being tested is
>> reported.
>>
>> Signed-off-by: Eryu Guan <eguan@redhat.com>
>> ---
>>
>> I'm not sure if kernel should be fixed, but limiting the quota report on
>> project number being tested seems something worth doing to me anyway. It avoids
>> breakage of future changes of quota report output.
>
> Hi,
>
> FYI:
> About "+(null) 0 0 0 00 [--------]"problem, it has been talked in:
> http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968
>
> I think:
> 1) If we consider that this's a bug, the original test cases can
> be the reproducer of this bug, so we shouldn't change the cases.
>
> 2) If we think print "(null) 0 0 0 00 [--------]" is right(or not
> wrong), then this patch is good.
yes, I'm sorry I didn't take care of this sooner.
I don't think there's value in printing the "(null)" line; I think maybe my
suggestion from that old thread might be best:
> We could explicitly look up id 0 and not show it if it's not in the
> projects file.
Or now that I think about it - projid 0 is the default project quota, right?
Assuming that's correct, perhaps we should conditionally print the line,
changing "(null)" to "default", printing it only if a default quota is
set (i.e. not all zeros).
-Eric
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
@ 2016-04-01 17:24 ` Eric Sandeen
0 siblings, 0 replies; 9+ messages in thread
From: Eric Sandeen @ 2016-04-01 17:24 UTC (permalink / raw)
To: Zorro Lang, Eryu Guan; +Cc: sandeen, fstests, xfs
On 4/1/16 2:28 AM, Zorro Lang wrote:
> On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
>> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
>> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
>> xfs/133 fails as
>>
>> Filesystem Blocks Quota Limit Warn/Time Mounted on
>> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
>> === report command output ===
>> +(null) 0 0 0 00 [--------]
>> 123456-project 0 102400 204800 00 [--------]
>>
>> Fix it by limiting xfs_quota to report on specific project quota number
>> using -L & -U option, so only the project quota being tested is
>> reported.
>>
>> Signed-off-by: Eryu Guan <eguan@redhat.com>
>> ---
>>
>> I'm not sure if kernel should be fixed, but limiting the quota report on
>> project number being tested seems something worth doing to me anyway. It avoids
>> breakage of future changes of quota report output.
>
> Hi,
>
> FYI:
> About "+(null) 0 0 0 00 [--------]"problem, it has been talked in:
> http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968
>
> I think:
> 1) If we consider that this's a bug, the original test cases can
> be the reproducer of this bug, so we shouldn't change the cases.
>
> 2) If we think print "(null) 0 0 0 00 [--------]" is right(or not
> wrong), then this patch is good.
yes, I'm sorry I didn't take care of this sooner.
I don't think there's value in printing the "(null)" line; I think maybe my
suggestion from that old thread might be best:
> We could explicitly look up id 0 and not show it if it's not in the
> projects file.
Or now that I think about it - projid 0 is the default project quota, right?
Assuming that's correct, perhaps we should conditionally print the line,
changing "(null)" to "default", printing it only if a default quota is
set (i.e. not all zeros).
-Eric
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
2016-04-01 17:24 ` Eric Sandeen
@ 2016-04-01 21:50 ` Dave Chinner
-1 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2016-04-01 21:50 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Zorro Lang, Eryu Guan, fstests, xfs, sandeen
On Fri, Apr 01, 2016 at 12:24:40PM -0500, Eric Sandeen wrote:
>
>
> On 4/1/16 2:28 AM, Zorro Lang wrote:
> > On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
> >> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
> >> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
> >> xfs/133 fails as
> >>
> >> Filesystem Blocks Quota Limit Warn/Time Mounted on
> >> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> >> === report command output ===
> >> +(null) 0 0 0 00 [--------]
> >> 123456-project 0 102400 204800 00 [--------]
> >>
> >> Fix it by limiting xfs_quota to report on specific project quota number
> >> using -L & -U option, so only the project quota being tested is
> >> reported.
> >>
> >> Signed-off-by: Eryu Guan <eguan@redhat.com>
> >> ---
> >>
> >> I'm not sure if kernel should be fixed, but limiting the quota report on
> >> project number being tested seems something worth doing to me anyway. It avoids
> >> breakage of future changes of quota report output.
> >
> > Hi,
> >
> > FYI:
> > About "+(null) 0 0 0 00 [--------]"problem, it has been talked in:
> > http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968
> >
> > I think:
> > 1) If we consider that this's a bug, the original test cases can
> > be the reproducer of this bug, so we shouldn't change the cases.
> >
> > 2) If we think print "(null) 0 0 0 00 [--------]" is right(or not
> > wrong), then this patch is good.
>
> yes, I'm sorry I didn't take care of this sooner.
>
> I don't think there's value in printing the "(null)" line; I think maybe my
> suggestion from that old thread might be best:
>
> > We could explicitly look up id 0 and not show it if it's not in the
> > projects file.
>
> Or now that I think about it - projid 0 is the default project quota, right?
"default" as in "project quota not enabled on this inode". i.e. if
an inode has projid == 0 then it is not tracked by project quotas.
> Assuming that's correct, perhaps we should conditionally print the line,
> changing "(null)" to "default", printing it only if a default quota is
> set (i.e. not all zeros).
Right, the only thing that the dquot for projid 0 holds is default
quota limits. We probably shouldn't ever print it out, except when
the default limits are queried or set directly...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
@ 2016-04-01 21:50 ` Dave Chinner
0 siblings, 0 replies; 9+ messages in thread
From: Dave Chinner @ 2016-04-01 21:50 UTC (permalink / raw)
To: Eric Sandeen; +Cc: sandeen, Zorro Lang, Eryu Guan, fstests, xfs
On Fri, Apr 01, 2016 at 12:24:40PM -0500, Eric Sandeen wrote:
>
>
> On 4/1/16 2:28 AM, Zorro Lang wrote:
> > On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
> >> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
> >> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
> >> xfs/133 fails as
> >>
> >> Filesystem Blocks Quota Limit Warn/Time Mounted on
> >> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> >> === report command output ===
> >> +(null) 0 0 0 00 [--------]
> >> 123456-project 0 102400 204800 00 [--------]
> >>
> >> Fix it by limiting xfs_quota to report on specific project quota number
> >> using -L & -U option, so only the project quota being tested is
> >> reported.
> >>
> >> Signed-off-by: Eryu Guan <eguan@redhat.com>
> >> ---
> >>
> >> I'm not sure if kernel should be fixed, but limiting the quota report on
> >> project number being tested seems something worth doing to me anyway. It avoids
> >> breakage of future changes of quota report output.
> >
> > Hi,
> >
> > FYI:
> > About "+(null) 0 0 0 00 [--------]"problem, it has been talked in:
> > http://thread.gmane.org/gmane.comp.file-systems.fstests/1852/focus=1968
> >
> > I think:
> > 1) If we consider that this's a bug, the original test cases can
> > be the reproducer of this bug, so we shouldn't change the cases.
> >
> > 2) If we think print "(null) 0 0 0 00 [--------]" is right(or not
> > wrong), then this patch is good.
>
> yes, I'm sorry I didn't take care of this sooner.
>
> I don't think there's value in printing the "(null)" line; I think maybe my
> suggestion from that old thread might be best:
>
> > We could explicitly look up id 0 and not show it if it's not in the
> > projects file.
>
> Or now that I think about it - projid 0 is the default project quota, right?
"default" as in "project quota not enabled on this inode". i.e. if
an inode has projid == 0 then it is not tracked by project quotas.
> Assuming that's correct, perhaps we should conditionally print the line,
> changing "(null)" to "default", printing it only if a default quota is
> set (i.e. not all zeros).
Right, the only thing that the dquot for projid 0 holds is default
quota limits. We probably shouldn't ever print it out, except when
the default limits are queried or set directly...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] xfs/133 134 262: limit xfs_quota report to report on specific project quota id
2016-04-01 7:00 ` Eryu Guan
(?)
(?)
@ 2016-05-11 8:26 ` Zorro Lang
-1 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2016-05-11 8:26 UTC (permalink / raw)
To: Eryu Guan; +Cc: xfs
Hi,
After the below xfsprogs patch has been merged:
3d607a1 xfs_quota: print quota id number if the name can't be found
so we can talk about this patch now. Please check below:
On Fri, Apr 01, 2016 at 03:00:50PM +0800, Eryu Guan wrote:
> With GETNEXTQUOTA support, xfs_quota -c "report" now outputs more quota
> info than before, and this breaks xfs/133 xfs/134 and xfs/262, e.g.
> xfs/133 fails as
>
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> === report command output ===
> +(null) 0 0 0 00 [--------]
> 123456-project 0 102400 204800 00 [--------]
>
> Fix it by limiting xfs_quota to report on specific project quota number
> using -L & -U option, so only the project quota being tested is
> reported.
>
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>
> I'm not sure if kernel should be fixed, but limiting the quota report on
> project number being tested seems something worth doing to me anyway. It avoids
> breakage of future changes of quota report output.
>
> tests/xfs/133 | 8 +++++---
> tests/xfs/133.out | 2 +-
> tests/xfs/134 | 22 +++++++++++++++-------
> tests/xfs/262 | 6 ++++--
> 4 files changed, 25 insertions(+), 13 deletions(-)
>
> diff --git a/tests/xfs/133 b/tests/xfs/133
> index 82c38b1..7a0e55e 100755
> --- a/tests/xfs/133
> +++ b/tests/xfs/133
> @@ -57,16 +57,17 @@ do_project_test()
> {
> local qa_project=123456-project
> local dir=$SCRATCH_MNT/project
> + local proj_num=10
>
> mkdir $dir 2>/dev/null
>
> #project quota files
> cat >$tmp.projects <<EOF
> -10:$dir
> +$proj_num:$dir
> EOF
>
> cat >$tmp.projid <<EOF
> -$qa_project:10
> +$qa_project:$proj_num
> EOF
>
> $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> @@ -81,7 +82,8 @@ EOF
>
> echo "=== report command output ==="
> $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> - -c "report -p -N -b" $SCRATCH_MNT | _filter_quota
> + -c "report -p -N -b -L $proj_num -U $proj_num" \
> + $SCRATCH_MNT | _filter_quota
The case used to reproduced some bugs caused by project name beginning
with digits. The "limit" and "quota" all maybe trigger this bug. The
last "report" command is used to help to sure the bug is in "limit"
or "quota" commands(It's not necessary but helpful).
If "quota" command can't print "123456-project", but "report" command
can, that means "quota" command can't deal with this project name
correctly.
If "quota" and "report" commands all can't print "123456-project", that
means "limit" can't create a limit for this project name correctly.
So we'd better keep report project name, not project ID (Although report
ID is OK too, but if the original one is better, why we change it.)
> }
>
> # Test project
> diff --git a/tests/xfs/133.out b/tests/xfs/133.out
> index 21cfd0d..8c747bf 100644
> --- a/tests/xfs/133.out
> +++ b/tests/xfs/133.out
> @@ -4,5 +4,5 @@ Disk quotas for Project 123456-project (10)
> Filesystem Blocks Quota Limit Warn/Time Mounted on
> SCRATCH_DEV 0 102400 204800 00 [--------] SCRATCH_MNT
> === report command output ===
> -123456-project 0 102400 204800 00 [--------]
> +#10 0 102400 204800 00 [--------]
>
> diff --git a/tests/xfs/134 b/tests/xfs/134
> index be18ee8..5ba275c 100755
> --- a/tests/xfs/134
> +++ b/tests/xfs/134
> @@ -54,12 +54,13 @@ _require_xfs_quota
> dir=$SCRATCH_MNT/project
>
> #project quota files
> +proj_num=1
> cat >$tmp.projects <<EOF
> -1:$dir
> +$proj_num:$dir
> EOF
>
> cat >$tmp.projid <<EOF
> -test:1
> +test:$proj_num
> EOF
>
> cp /dev/null $seqres.full
> @@ -87,17 +88,24 @@ fi
> src/feature -p $SCRATCH_DEV
> [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
>
> +report_quota()
> +{
> + $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> + -c "repquota -inN -p -L $proj_num -U $proj_num" $SCRATCH_DEV | \
> + tr -s '[:space:]'
> +}
> +
> mkdir $dir
> $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x \
> +$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
> touch $dir/1
> touch $dir/2
> cp $dir/2 $dir/3
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> if [ "$HOSTOS" == "IRIX" ] ; then
> mkfile 1M $TEST_DIR/6
> @@ -107,12 +115,12 @@ fi
>
> #try cp to dir
> cp $TEST_DIR/6 $dir/6
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
>
> #try mv to dir
> mv $TEST_DIR/6 $dir/7
>
> -xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
> +report_quota
Due to this case hope to print ID number, so this change is OK.
>
> # success, all done
> status=0
> diff --git a/tests/xfs/262 b/tests/xfs/262
> index 9d8b838..d3a352c 100755
> --- a/tests/xfs/262
> +++ b/tests/xfs/262
> @@ -138,11 +138,13 @@ _quota_cmd "limit -p bhard=${qlimit_meg}m bsoft=${qlimit_meg}m ${proj_name}" \
> 2>> "$seqres.full" 1>&2
>
> # See what gets reported
> -_quota_cmd "report" | _filter_quota_rpt 2>> "$seqres.full"
> +_quota_cmd "report -U $proj_num -L $proj_num" | _filter_quota_rpt \
> + 2>> $seqres.full
> _quota_cmd "df" | _filter_quota_rpt 2>> "$seqres.full"
>
> # This time using "human readable" output
> -_quota_cmd "report -h" | _filter_quota_rpt 2>> "$seqres.full"
> +_quota_cmd "report -h $proj_num -L $proj_num" | _filter_quota_rpt \
> + 2>> "$seqres.full"
The _filter_quota_rpt() in this case already can deal with
this problem. It will check "if ($1 =~ proj_name)". So I think
we don't need more change on this case which can work well.
> _quota_cmd "df -h" | _filter_quota_rpt 2>> "$seqres.full"
>
> # Clean up
> --
> 2.5.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 9+ messages in thread