All of lore.kernel.org
 help / color / mirror / Atom feed
* prepare for removing support to disable quota accounting
@ 2021-07-12 11:11 Christoph Hellwig
  2021-07-12 11:11 ` [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option Christoph Hellwig
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

Hi all,

this series contains all the patches to make xfstests cope with a kernel
that does not support disabling quota accounting on a running XFS file
system.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option
  2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
@ 2021-07-12 11:11 ` Christoph Hellwig
  2021-07-14 23:35   ` Darrick J. Wong
  2021-07-12 11:11 ` [PATCH 2/6] xfs/007: unmount after disabling quota Christoph Hellwig
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

Add support for dropping all quota related options instead of only
overriding them with new ones to _qmount_option.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 common/quota | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/quota b/common/quota
index 883a28a2..7fa1a61a 100644
--- a/common/quota
+++ b/common/quota
@@ -263,7 +263,9 @@ _qmount_option()
 			-e 's/prjquota/quota/g'`
 	fi
 	# Ensure we have the given quota option - duplicates are fine
-	export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
+	if [ -n "$OPTS" ]; then
+		export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
+	fi
 	echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full
 }
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 2/6] xfs/007: unmount after disabling quota
  2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
  2021-07-12 11:11 ` [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option Christoph Hellwig
@ 2021-07-12 11:11 ` Christoph Hellwig
  2021-07-14 23:35   ` Darrick J. Wong
  2021-07-12 11:11 ` [PATCH 3/6] xfs/106: don't test disabling quota accounting Christoph Hellwig
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

With the pending patches to remove support for disabling quota
accounting on a mounted file system we need to unmount the
file system first before removing the quota files.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/007 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/xfs/007 b/tests/xfs/007
index 09268e8c..d1946524 100755
--- a/tests/xfs/007
+++ b/tests/xfs/007
@@ -41,6 +41,9 @@ do_test()
 	_qmount
 	echo "*** turn off $off_opts quotas"
 	xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
+	_scratch_unmount
+	_qmount_option ""
+	_scratch_mount
 	xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
 	echo "*** umount"
 	_scratch_unmount
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 3/6] xfs/106: don't test disabling quota accounting
  2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
  2021-07-12 11:11 ` [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option Christoph Hellwig
  2021-07-12 11:11 ` [PATCH 2/6] xfs/007: unmount after disabling quota Christoph Hellwig
@ 2021-07-12 11:11 ` Christoph Hellwig
  2021-07-14 23:37   ` Darrick J. Wong
  2021-07-12 11:11 ` [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported Christoph Hellwig
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

Switch the test that removes the quota files to just disable
enforcement and then unmount the file system as disabling quota
accounting is about to go away.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/106     | 45 ++++++++++++++++++-------------------
 tests/xfs/106.out | 57 +++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 70 insertions(+), 32 deletions(-)

diff --git a/tests/xfs/106 b/tests/xfs/106
index f1397f94..5f0512d6 100755
--- a/tests/xfs/106
+++ b/tests/xfs/106
@@ -153,13 +153,6 @@ test_enable()
 			-c "enable -$type -v" $SCRATCH_MNT | filter_state
 }
 
-test_off()
-{
-	echo "checking off command (type=$type)"
-	$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
-			-c "off -$type -v" $SCRATCH_MNT | _filter_scratch
-}
-
 test_remove()
 {
 	echo "checking remove command (type=$type)"
@@ -194,6 +187,15 @@ test_restore()
 
 test_xfs_quota()
 {
+	_qmount_option $1
+	_qmount
+
+	if [ $type == "p" ]; then
+		_require_prjquota $SCRATCH_DEV
+		$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
+			-c "project -s $id" $SCRATCH_MNT > /dev/null
+	fi
+
 	# init quota
 	echo "init quota limit and timer, and dump it"
 	echo "create_files 1024k 15"; create_files 1024k 15
@@ -236,14 +238,21 @@ test_xfs_quota()
 	echo ; test_report -N
 
 	# off and remove test
-	echo "off and remove test"
+	echo "disable and remove test"
 	echo ; test_limit 100m 100m 100 100
 	echo ; test_quota -N
-	echo ; test_off
+	echo ; test_disable
 	echo ; test_state
+	_scratch_unmount
+	_qmount_option ""
+	_qmount
 	echo ; test_remove
 	echo ; test_report -N
-	echo "quota remount"; _qmount
+	_scratch_unmount
+
+	echo "quota remount";
+	_qmount_option $1
+	_qmount
 	echo ; test_report -N
 
 	# restore test
@@ -255,33 +264,23 @@ test_xfs_quota()
 }
 
 echo "----------------------- uquota,sync ---------------------------"
-_qmount_option "uquota,sync"
-_qmount
 type=u
 id=$uqid
-test_xfs_quota
+test_xfs_quota "uquota,sync"
 
 echo "----------------------- gquota,sync ---------------------------"
-_qmount_option "gquota,sync"
-_qmount
 type=g
 id=$gqid
-test_xfs_quota
+test_xfs_quota "gquota,sync"
 
 echo "----------------------- pquota,sync ---------------------------"
 # Need to clean the group quota before test project quota, because
 # V4 xfs doesn't support separate project inode. So mkfs at here.
 _scratch_unmount
 _scratch_mkfs_xfs >>$seqres.full 2>&1
-_qmount_option "pquota,sync"
-_qmount
 type=p
 id=$pqid
-_require_prjquota $SCRATCH_DEV
-$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
-		-c "project -s $id" \
-		$SCRATCH_MNT > /dev/null
-test_xfs_quota
+test_xfs_quota "pquota,sync"
 
 _scratch_unmount
 # success, all done
diff --git a/tests/xfs/106.out b/tests/xfs/106.out
index e36375d3..2af17bc9 100644
--- a/tests/xfs/106.out
+++ b/tests/xfs/106.out
@@ -124,17 +124,30 @@ Realtime Blocks grace time: [7 days]
 checking report command (type=u)
 fsgqa 1024 512 2048 00 [3 days] 15 10 20 00 [3 days]
 
-off and remove test
+disable and remove test
 
 checking limit command (type=u, bsoft=100m, bhard=100m, isoft=100, ihard=100)
 
 checking quota command (type=u)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
-checking off command (type=u)
-User quota are not enabled on SCRATCH_DEV
+checking disable command (type=u)
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+ Accounting: ON
+ Enforcement: OFF
+ Inode: #[INO] (X blocks, Y extents)
+Blocks grace time: [3 days]
+Inodes grace time: [3 days]
+Realtime Blocks grace time: [7 days]
 
 checking state command (type=u)
+User quota state on SCRATCH_MNT (SCRATCH_DEV)
+ Accounting: ON
+ Enforcement: OFF
+ Inode: #[INO] (X blocks, Y extents)
+Blocks grace time: [3 days]
+Inodes grace time: [3 days]
+Realtime Blocks grace time: [7 days]
 
 checking remove command (type=u)
 User quota are not enabled on SCRATCH_DEV
@@ -288,17 +301,30 @@ Realtime Blocks grace time: [7 days]
 checking report command (type=g)
 fsgqa 1024 512 2048 00 [3 days] 15 10 20 00 [3 days]
 
-off and remove test
+disable and remove test
 
 checking limit command (type=g, bsoft=100m, bhard=100m, isoft=100, ihard=100)
 
 checking quota command (type=g)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
-checking off command (type=g)
-Group quota are not enabled on SCRATCH_DEV
+checking disable command (type=g)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+ Accounting: ON
+ Enforcement: OFF
+ Inode: #[INO] (X blocks, Y extents)
+Blocks grace time: [3 days]
+Inodes grace time: [3 days]
+Realtime Blocks grace time: [7 days]
 
 checking state command (type=g)
+Group quota state on SCRATCH_MNT (SCRATCH_DEV)
+ Accounting: ON
+ Enforcement: OFF
+ Inode: #[INO] (X blocks, Y extents)
+Blocks grace time: [3 days]
+Inodes grace time: [3 days]
+Realtime Blocks grace time: [7 days]
 
 checking remove command (type=g)
 Group quota are not enabled on SCRATCH_DEV
@@ -452,17 +478,30 @@ Realtime Blocks grace time: [7 days]
 checking report command (type=p)
 fsgqa 1024 512 2048 00 [3 days] 15 10 20 00 [3 days]
 
-off and remove test
+disable and remove test
 
 checking limit command (type=p, bsoft=100m, bhard=100m, isoft=100, ihard=100)
 
 checking quota command (type=p)
 SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
 
-checking off command (type=p)
-Project quota are not enabled on SCRATCH_DEV
+checking disable command (type=p)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+ Accounting: ON
+ Enforcement: OFF
+ Inode: #[INO] (X blocks, Y extents)
+Blocks grace time: [3 days]
+Inodes grace time: [3 days]
+Realtime Blocks grace time: [7 days]
 
 checking state command (type=p)
+Project quota state on SCRATCH_MNT (SCRATCH_DEV)
+ Accounting: ON
+ Enforcement: OFF
+ Inode: #[INO] (X blocks, Y extents)
+Blocks grace time: [3 days]
+Inodes grace time: [3 days]
+Realtime Blocks grace time: [7 days]
 
 checking remove command (type=p)
 Project quota are not enabled on SCRATCH_DEV
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported
  2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
                   ` (2 preceding siblings ...)
  2021-07-12 11:11 ` [PATCH 3/6] xfs/106: don't test disabling quota accounting Christoph Hellwig
@ 2021-07-12 11:11 ` Christoph Hellwig
  2021-07-14 23:30   ` Darrick J. Wong
  2021-07-12 11:11 ` [PATCH 5/6] xfs/304: don't turn quota accounting off Christoph Hellwig
  2021-07-12 11:11 ` [PATCH 6/6] xfs/305: " Christoph Hellwig
  5 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

Doing a proper _requires for quotaoff support is rather hard, as we need
to test it on a specific file system.  Instead just use sed to remove
the warning and let the test case pass.  Eventually it should just be
removed entirely.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/220 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/xfs/220 b/tests/xfs/220
index 8d955225..c847a0dc 100755
--- a/tests/xfs/220
+++ b/tests/xfs/220
@@ -54,7 +54,12 @@ _scratch_mount -o uquota
 
 # turn off quota and remove space allocated to the quota files
 # (this used to give wrong ENOSYS returns in 2.6.31)
-xfs_quota -x -c off -c remove $SCRATCH_DEV
+#
+# The sed expression below replaces a notrun to cater for kernels that have
+# removed the ability to disable quota accounting at runtime.  On those
+# kernel this test is rather useless, and in a few years we can drop it.
+xfs_quota -x -c off -c remove $SCRATCH_DEV 2>&1 | \
+	sed -e '/XFS_QUOTARM: Invalid argument/d'
 
 # and unmount again
 _scratch_unmount
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 5/6] xfs/304: don't turn quota accounting off
  2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
                   ` (3 preceding siblings ...)
  2021-07-12 11:11 ` [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported Christoph Hellwig
@ 2021-07-12 11:11 ` Christoph Hellwig
  2021-07-14 23:29   ` Darrick J. Wong
  2021-07-12 11:11 ` [PATCH 6/6] xfs/305: " Christoph Hellwig
  5 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

The test case tests just as much when just testing turning quota
enforcement off, so switch it to that.  This is in preparation for
removing support to turn quota accounting off.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/304 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/xfs/304 b/tests/xfs/304
index 2716ccd5..91fa5d97 100755
--- a/tests/xfs/304
+++ b/tests/xfs/304
@@ -31,7 +31,7 @@ QUOTA_DIR=$SCRATCH_MNT/quota_dir
 
 mkdir -p $QUOTA_DIR
 echo "*** turn off group quotas"
-xfs_quota -x -c 'off -g' $SCRATCH_MNT
+xfs_quota -x -c 'disable -g' $SCRATCH_MNT
 rmdir $QUOTA_DIR
 echo "*** umount"
 _scratch_unmount
@@ -39,7 +39,7 @@ _scratch_unmount
 _qmount
 mkdir -p $QUOTA_DIR
 echo "*** turn off project quotas"
-xfs_quota -x -c 'off -p' $SCRATCH_MNT
+xfs_quota -x -c 'disable -p' $SCRATCH_MNT
 rmdir $QUOTA_DIR
 echo "*** umount"
 _scratch_unmount
@@ -47,7 +47,7 @@ _scratch_unmount
 _qmount
 mkdir -p $QUOTA_DIR
 echo "*** turn off group/project quotas"
-xfs_quota -x -c 'off -gp' $SCRATCH_MNT
+xfs_quota -x -c 'disable -gp' $SCRATCH_MNT
 rmdir $QUOTA_DIR
 echo "*** umount"
 _scratch_unmount
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH 6/6] xfs/305: don't turn quota accounting off
  2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
                   ` (4 preceding siblings ...)
  2021-07-12 11:11 ` [PATCH 5/6] xfs/304: don't turn quota accounting off Christoph Hellwig
@ 2021-07-12 11:11 ` Christoph Hellwig
  2021-07-14 23:28   ` Darrick J. Wong
  5 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-12 11:11 UTC (permalink / raw)
  To: fstests; +Cc: linux-xfs

The test case tests just as much when just testing turning quota
enforcement off, so switch it to that.  This is in preparation for
removing support to turn quota accounting off.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/305 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/xfs/305 b/tests/xfs/305
index 140557a0..0b89499a 100755
--- a/tests/xfs/305
+++ b/tests/xfs/305
@@ -38,7 +38,7 @@ _exercise()
 
 	$FSSTRESS_PROG -d $QUOTA_DIR -n 1000000 -p 100 $FSSTRESS_AVOID >/dev/null 2>&1 &
 	sleep 10
-	xfs_quota -x -c "off -$type" $SCRATCH_DEV
+	xfs_quota -x -c "disable -$type" $SCRATCH_DEV
 	sleep 5
 	$KILLALL_PROG -q $FSSTRESS_PROG
 	wait
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH 6/6] xfs/305: don't turn quota accounting off
  2021-07-12 11:11 ` [PATCH 6/6] xfs/305: " Christoph Hellwig
@ 2021-07-14 23:28   ` Darrick J. Wong
  0 siblings, 0 replies; 14+ messages in thread
From: Darrick J. Wong @ 2021-07-14 23:28 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: fstests, linux-xfs

On Mon, Jul 12, 2021 at 01:11:46PM +0200, Christoph Hellwig wrote:
> The test case tests just as much when just testing turning quota
> enforcement off, so switch it to that.  This is in preparation for
> removing support to turn quota accounting off.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good to me,
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/305 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/xfs/305 b/tests/xfs/305
> index 140557a0..0b89499a 100755
> --- a/tests/xfs/305
> +++ b/tests/xfs/305
> @@ -38,7 +38,7 @@ _exercise()
>  
>  	$FSSTRESS_PROG -d $QUOTA_DIR -n 1000000 -p 100 $FSSTRESS_AVOID >/dev/null 2>&1 &
>  	sleep 10
> -	xfs_quota -x -c "off -$type" $SCRATCH_DEV
> +	xfs_quota -x -c "disable -$type" $SCRATCH_DEV
>  	sleep 5
>  	$KILLALL_PROG -q $FSSTRESS_PROG
>  	wait
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 5/6] xfs/304: don't turn quota accounting off
  2021-07-12 11:11 ` [PATCH 5/6] xfs/304: don't turn quota accounting off Christoph Hellwig
@ 2021-07-14 23:29   ` Darrick J. Wong
  0 siblings, 0 replies; 14+ messages in thread
From: Darrick J. Wong @ 2021-07-14 23:29 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: fstests, linux-xfs

On Mon, Jul 12, 2021 at 01:11:45PM +0200, Christoph Hellwig wrote:
> The test case tests just as much when just testing turning quota
> enforcement off, so switch it to that.  This is in preparation for
> removing support to turn quota accounting off.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/304 | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/xfs/304 b/tests/xfs/304
> index 2716ccd5..91fa5d97 100755
> --- a/tests/xfs/304
> +++ b/tests/xfs/304
> @@ -31,7 +31,7 @@ QUOTA_DIR=$SCRATCH_MNT/quota_dir
>  
>  mkdir -p $QUOTA_DIR
>  echo "*** turn off group quotas"
> -xfs_quota -x -c 'off -g' $SCRATCH_MNT
> +xfs_quota -x -c 'disable -g' $SCRATCH_MNT
>  rmdir $QUOTA_DIR
>  echo "*** umount"
>  _scratch_unmount
> @@ -39,7 +39,7 @@ _scratch_unmount
>  _qmount
>  mkdir -p $QUOTA_DIR
>  echo "*** turn off project quotas"
> -xfs_quota -x -c 'off -p' $SCRATCH_MNT
> +xfs_quota -x -c 'disable -p' $SCRATCH_MNT
>  rmdir $QUOTA_DIR
>  echo "*** umount"
>  _scratch_unmount
> @@ -47,7 +47,7 @@ _scratch_unmount
>  _qmount
>  mkdir -p $QUOTA_DIR
>  echo "*** turn off group/project quotas"
> -xfs_quota -x -c 'off -gp' $SCRATCH_MNT
> +xfs_quota -x -c 'disable -gp' $SCRATCH_MNT
>  rmdir $QUOTA_DIR
>  echo "*** umount"
>  _scratch_unmount
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported
  2021-07-12 11:11 ` [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported Christoph Hellwig
@ 2021-07-14 23:30   ` Darrick J. Wong
  2021-07-20  6:37     ` Christoph Hellwig
  0 siblings, 1 reply; 14+ messages in thread
From: Darrick J. Wong @ 2021-07-14 23:30 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: fstests, linux-xfs

On Mon, Jul 12, 2021 at 01:11:44PM +0200, Christoph Hellwig wrote:
> Doing a proper _requires for quotaoff support is rather hard, as we need
> to test it on a specific file system.  Instead just use sed to remove
> the warning and let the test case pass.  Eventually it should just be
> removed entirely.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/xfs/220 | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/xfs/220 b/tests/xfs/220
> index 8d955225..c847a0dc 100755
> --- a/tests/xfs/220
> +++ b/tests/xfs/220
> @@ -54,7 +54,12 @@ _scratch_mount -o uquota
>  
>  # turn off quota and remove space allocated to the quota files
>  # (this used to give wrong ENOSYS returns in 2.6.31)
> -xfs_quota -x -c off -c remove $SCRATCH_DEV
> +#
> +# The sed expression below replaces a notrun to cater for kernels that have
> +# removed the ability to disable quota accounting at runtime.  On those
> +# kernel this test is rather useless, and in a few years we can drop it.
> +xfs_quota -x -c off -c remove $SCRATCH_DEV 2>&1 | \

Please replace 'xfs_quota' with '$XFS_QUOTA_PROG' in all these tests
you're touching.

> +	sed -e '/XFS_QUOTARM: Invalid argument/d'

Between 'off' and 'remove', which one returned EINVAL?

--D

>  
>  # and unmount again
>  _scratch_unmount
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option
  2021-07-12 11:11 ` [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option Christoph Hellwig
@ 2021-07-14 23:35   ` Darrick J. Wong
  0 siblings, 0 replies; 14+ messages in thread
From: Darrick J. Wong @ 2021-07-14 23:35 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: fstests, linux-xfs

On Mon, Jul 12, 2021 at 01:11:41PM +0200, Christoph Hellwig wrote:
> Add support for dropping all quota related options instead of only
> overriding them with new ones to _qmount_option.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  common/quota | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/quota b/common/quota
> index 883a28a2..7fa1a61a 100644
> --- a/common/quota
> +++ b/common/quota
> @@ -263,7 +263,9 @@ _qmount_option()
>  			-e 's/prjquota/quota/g'`
>  	fi
>  	# Ensure we have the given quota option - duplicates are fine
> -	export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
> +	if [ -n "$OPTS" ]; then
> +		export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
> +	fi

/me finds it a little weird and gross that repeated calls to
_qmount_option lead to a really ugly $MOUNT_OPTIONS, but disentangling
/that/ mess is probably best left for another time...

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

>  	echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full
>  }
>  
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/6] xfs/007: unmount after disabling quota
  2021-07-12 11:11 ` [PATCH 2/6] xfs/007: unmount after disabling quota Christoph Hellwig
@ 2021-07-14 23:35   ` Darrick J. Wong
  0 siblings, 0 replies; 14+ messages in thread
From: Darrick J. Wong @ 2021-07-14 23:35 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: fstests, linux-xfs

On Mon, Jul 12, 2021 at 01:11:42PM +0200, Christoph Hellwig wrote:
> With the pending patches to remove support for disabling quota
> accounting on a mounted file system we need to unmount the
> file system first before removing the quota files.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  tests/xfs/007 | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/xfs/007 b/tests/xfs/007
> index 09268e8c..d1946524 100755
> --- a/tests/xfs/007
> +++ b/tests/xfs/007
> @@ -41,6 +41,9 @@ do_test()
>  	_qmount
>  	echo "*** turn off $off_opts quotas"
>  	xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
> +	_scratch_unmount
> +	_qmount_option ""
> +	_scratch_mount
>  	xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
>  	echo "*** umount"
>  	_scratch_unmount
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/6] xfs/106: don't test disabling quota accounting
  2021-07-12 11:11 ` [PATCH 3/6] xfs/106: don't test disabling quota accounting Christoph Hellwig
@ 2021-07-14 23:37   ` Darrick J. Wong
  0 siblings, 0 replies; 14+ messages in thread
From: Darrick J. Wong @ 2021-07-14 23:37 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: fstests, linux-xfs

On Mon, Jul 12, 2021 at 01:11:43PM +0200, Christoph Hellwig wrote:
> Switch the test that removes the quota files to just disable
> enforcement and then unmount the file system as disabling quota
> accounting is about to go away.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  tests/xfs/106     | 45 ++++++++++++++++++-------------------
>  tests/xfs/106.out | 57 +++++++++++++++++++++++++++++++++++++++--------
>  2 files changed, 70 insertions(+), 32 deletions(-)
> 
> diff --git a/tests/xfs/106 b/tests/xfs/106
> index f1397f94..5f0512d6 100755
> --- a/tests/xfs/106
> +++ b/tests/xfs/106
> @@ -153,13 +153,6 @@ test_enable()
>  			-c "enable -$type -v" $SCRATCH_MNT | filter_state
>  }
>  
> -test_off()
> -{
> -	echo "checking off command (type=$type)"
> -	$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> -			-c "off -$type -v" $SCRATCH_MNT | _filter_scratch
> -}
> -
>  test_remove()
>  {
>  	echo "checking remove command (type=$type)"
> @@ -194,6 +187,15 @@ test_restore()
>  
>  test_xfs_quota()
>  {
> +	_qmount_option $1
> +	_qmount
> +
> +	if [ $type == "p" ]; then
> +		_require_prjquota $SCRATCH_DEV
> +		$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> +			-c "project -s $id" $SCRATCH_MNT > /dev/null
> +	fi
> +
>  	# init quota
>  	echo "init quota limit and timer, and dump it"
>  	echo "create_files 1024k 15"; create_files 1024k 15
> @@ -236,14 +238,21 @@ test_xfs_quota()
>  	echo ; test_report -N
>  
>  	# off and remove test
> -	echo "off and remove test"
> +	echo "disable and remove test"
>  	echo ; test_limit 100m 100m 100 100
>  	echo ; test_quota -N
> -	echo ; test_off
> +	echo ; test_disable
>  	echo ; test_state
> +	_scratch_unmount
> +	_qmount_option ""
> +	_qmount

Why not make these three lines the method body of test_off() ?

--D

>  	echo ; test_remove
>  	echo ; test_report -N
> -	echo "quota remount"; _qmount
> +	_scratch_unmount
> +
> +	echo "quota remount";
> +	_qmount_option $1
> +	_qmount
>  	echo ; test_report -N
>  
>  	# restore test
> @@ -255,33 +264,23 @@ test_xfs_quota()
>  }
>  
>  echo "----------------------- uquota,sync ---------------------------"
> -_qmount_option "uquota,sync"
> -_qmount
>  type=u
>  id=$uqid
> -test_xfs_quota
> +test_xfs_quota "uquota,sync"
>  
>  echo "----------------------- gquota,sync ---------------------------"
> -_qmount_option "gquota,sync"
> -_qmount
>  type=g
>  id=$gqid
> -test_xfs_quota
> +test_xfs_quota "gquota,sync"
>  
>  echo "----------------------- pquota,sync ---------------------------"
>  # Need to clean the group quota before test project quota, because
>  # V4 xfs doesn't support separate project inode. So mkfs at here.
>  _scratch_unmount
>  _scratch_mkfs_xfs >>$seqres.full 2>&1
> -_qmount_option "pquota,sync"
> -_qmount
>  type=p
>  id=$pqid
> -_require_prjquota $SCRATCH_DEV
> -$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
> -		-c "project -s $id" \
> -		$SCRATCH_MNT > /dev/null
> -test_xfs_quota
> +test_xfs_quota "pquota,sync"
>  
>  _scratch_unmount
>  # success, all done
> diff --git a/tests/xfs/106.out b/tests/xfs/106.out
> index e36375d3..2af17bc9 100644
> --- a/tests/xfs/106.out
> +++ b/tests/xfs/106.out
> @@ -124,17 +124,30 @@ Realtime Blocks grace time: [7 days]
>  checking report command (type=u)
>  fsgqa 1024 512 2048 00 [3 days] 15 10 20 00 [3 days]
>  
> -off and remove test
> +disable and remove test
>  
>  checking limit command (type=u, bsoft=100m, bhard=100m, isoft=100, ihard=100)
>  
>  checking quota command (type=u)
>  SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
>  
> -checking off command (type=u)
> -User quota are not enabled on SCRATCH_DEV
> +checking disable command (type=u)
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> + Accounting: ON
> + Enforcement: OFF
> + Inode: #[INO] (X blocks, Y extents)
> +Blocks grace time: [3 days]
> +Inodes grace time: [3 days]
> +Realtime Blocks grace time: [7 days]
>  
>  checking state command (type=u)
> +User quota state on SCRATCH_MNT (SCRATCH_DEV)
> + Accounting: ON
> + Enforcement: OFF
> + Inode: #[INO] (X blocks, Y extents)
> +Blocks grace time: [3 days]
> +Inodes grace time: [3 days]
> +Realtime Blocks grace time: [7 days]
>  
>  checking remove command (type=u)
>  User quota are not enabled on SCRATCH_DEV
> @@ -288,17 +301,30 @@ Realtime Blocks grace time: [7 days]
>  checking report command (type=g)
>  fsgqa 1024 512 2048 00 [3 days] 15 10 20 00 [3 days]
>  
> -off and remove test
> +disable and remove test
>  
>  checking limit command (type=g, bsoft=100m, bhard=100m, isoft=100, ihard=100)
>  
>  checking quota command (type=g)
>  SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
>  
> -checking off command (type=g)
> -Group quota are not enabled on SCRATCH_DEV
> +checking disable command (type=g)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> + Accounting: ON
> + Enforcement: OFF
> + Inode: #[INO] (X blocks, Y extents)
> +Blocks grace time: [3 days]
> +Inodes grace time: [3 days]
> +Realtime Blocks grace time: [7 days]
>  
>  checking state command (type=g)
> +Group quota state on SCRATCH_MNT (SCRATCH_DEV)
> + Accounting: ON
> + Enforcement: OFF
> + Inode: #[INO] (X blocks, Y extents)
> +Blocks grace time: [3 days]
> +Inodes grace time: [3 days]
> +Realtime Blocks grace time: [7 days]
>  
>  checking remove command (type=g)
>  Group quota are not enabled on SCRATCH_DEV
> @@ -452,17 +478,30 @@ Realtime Blocks grace time: [7 days]
>  checking report command (type=p)
>  fsgqa 1024 512 2048 00 [3 days] 15 10 20 00 [3 days]
>  
> -off and remove test
> +disable and remove test
>  
>  checking limit command (type=p, bsoft=100m, bhard=100m, isoft=100, ihard=100)
>  
>  checking quota command (type=p)
>  SCRATCH_DEV 1024 102400 102400 00 [--------] 15 100 100 00 [--------] SCRATCH_MNT
>  
> -checking off command (type=p)
> -Project quota are not enabled on SCRATCH_DEV
> +checking disable command (type=p)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> + Accounting: ON
> + Enforcement: OFF
> + Inode: #[INO] (X blocks, Y extents)
> +Blocks grace time: [3 days]
> +Inodes grace time: [3 days]
> +Realtime Blocks grace time: [7 days]
>  
>  checking state command (type=p)
> +Project quota state on SCRATCH_MNT (SCRATCH_DEV)
> + Accounting: ON
> + Enforcement: OFF
> + Inode: #[INO] (X blocks, Y extents)
> +Blocks grace time: [3 days]
> +Inodes grace time: [3 days]
> +Realtime Blocks grace time: [7 days]
>  
>  checking remove command (type=p)
>  Project quota are not enabled on SCRATCH_DEV
> -- 
> 2.30.2
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported
  2021-07-14 23:30   ` Darrick J. Wong
@ 2021-07-20  6:37     ` Christoph Hellwig
  0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2021-07-20  6:37 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Christoph Hellwig, fstests, linux-xfs

On Wed, Jul 14, 2021 at 04:30:49PM -0700, Darrick J. Wong wrote:
> > +#
> > +# The sed expression below replaces a notrun to cater for kernels that have
> > +# removed the ability to disable quota accounting at runtime.  On those
> > +# kernel this test is rather useless, and in a few years we can drop it.
> > +xfs_quota -x -c off -c remove $SCRATCH_DEV 2>&1 | \
> 
> Please replace 'xfs_quota' with '$XFS_QUOTA_PROG' in all these tests
> you're touching.
> 
> > +	sed -e '/XFS_QUOTARM: Invalid argument/d'
> 
> Between 'off' and 'remove', which one returned EINVAL?

remove, as the file system is still using the quota files.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-07-20  6:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-12 11:11 prepare for removing support to disable quota accounting Christoph Hellwig
2021-07-12 11:11 ` [PATCH 1/6] common/quota: allow removing quota options entirely in _qmount_option Christoph Hellwig
2021-07-14 23:35   ` Darrick J. Wong
2021-07-12 11:11 ` [PATCH 2/6] xfs/007: unmount after disabling quota Christoph Hellwig
2021-07-14 23:35   ` Darrick J. Wong
2021-07-12 11:11 ` [PATCH 3/6] xfs/106: don't test disabling quota accounting Christoph Hellwig
2021-07-14 23:37   ` Darrick J. Wong
2021-07-12 11:11 ` [PATCH 4/6] xfs/220: avoid failure when disabling quota accounting is not supported Christoph Hellwig
2021-07-14 23:30   ` Darrick J. Wong
2021-07-20  6:37     ` Christoph Hellwig
2021-07-12 11:11 ` [PATCH 5/6] xfs/304: don't turn quota accounting off Christoph Hellwig
2021-07-14 23:29   ` Darrick J. Wong
2021-07-12 11:11 ` [PATCH 6/6] xfs/305: " Christoph Hellwig
2021-07-14 23:28   ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.