diff mbox series

[03/10] generic/710: repurpose this for exchangerange vs. quota testing

Message ID 171867145344.793463.2045134533110555641.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [01/10] misc: split swapext and exchangerange | expand

Commit Message

Darrick J. Wong June 18, 2024, 12:47 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

The exchange-range implementation is now completely separate from the
old swapext ioctl.  We're deprecating the old swapext ioctl, so let's
move this test to use exchangerange.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/generic/710     |   14 +++++++-------
 tests/generic/710.out |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

Comments

Christoph Hellwig June 19, 2024, 6:08 a.m. UTC | #1
On Mon, Jun 17, 2024 at 05:47:32PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> The exchange-range implementation is now completely separate from the
> old swapext ioctl.  We're deprecating the old swapext ioctl, so let's
> move this test to use exchangerange.

Do we really want to lost the swapext test coverage?  Even if it is
deprecated, it will be with us for a long time.  My vote for copy and
pasting this into a new test for exchrange.
Darrick J. Wong June 19, 2024, 5:23 p.m. UTC | #2
On Tue, Jun 18, 2024 at 11:08:37PM -0700, Christoph Hellwig wrote:
> On Mon, Jun 17, 2024 at 05:47:32PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > The exchange-range implementation is now completely separate from the
> > old swapext ioctl.  We're deprecating the old swapext ioctl, so let's
> > move this test to use exchangerange.
> 
> Do we really want to lost the swapext test coverage?  Even if it is
> deprecated, it will be with us for a long time.  My vote for copy and
> pasting this into a new test for exchrange.

Yeah, you're right that we should retain this test for the old swapext
ioctl.  I'll fork the test into two -- one for swapext, another for
exchangerange.

--D
Darrick J. Wong June 20, 2024, 4:55 p.m. UTC | #3
On Wed, Jun 19, 2024 at 10:23:18AM -0700, Darrick J. Wong wrote:
> On Tue, Jun 18, 2024 at 11:08:37PM -0700, Christoph Hellwig wrote:
> > On Mon, Jun 17, 2024 at 05:47:32PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > > 
> > > The exchange-range implementation is now completely separate from the
> > > old swapext ioctl.  We're deprecating the old swapext ioctl, so let's
> > > move this test to use exchangerange.
> > 
> > Do we really want to lost the swapext test coverage?  Even if it is
> > deprecated, it will be with us for a long time.  My vote for copy and
> > pasting this into a new test for exchrange.
> 
> Yeah, you're right that we should retain this test for the old swapext
> ioctl.  I'll fork the test into two -- one for swapext, another for
> exchangerange.

...except that the swapext ioctl doesn't support swapping forks if quota
is enabled and any of the user/group/project ids are different:


	/* User/group/project quota ids must match if quotas are enforced. */
	if (XFS_IS_QUOTA_ON(ip->i_mount) &&
	    (!uid_eq(VFS_I(ip)->i_uid, VFS_I(tip)->i_uid) ||
	     !gid_eq(VFS_I(ip)->i_gid, VFS_I(tip)->i_gid) ||
	     ip->i_projid != tip->i_projid))
		return -EINVAL;

I'll amend the commit message:

"There's no point in maintaining this test for the legacy swapext code
because it returns EINVAL if any quota is enabled and the two files have
different user/group/project ids.  Originally I had forward ported the
old swapext ioctl to use commitrange as its backend, but that will be
dropped in favor of porting xfs_fsr to use commitrange directly."

--D
Zorro Lang June 20, 2024, 7:06 p.m. UTC | #4
On Thu, Jun 20, 2024 at 09:55:26AM -0700, Darrick J. Wong wrote:
> On Wed, Jun 19, 2024 at 10:23:18AM -0700, Darrick J. Wong wrote:
> > On Tue, Jun 18, 2024 at 11:08:37PM -0700, Christoph Hellwig wrote:
> > > On Mon, Jun 17, 2024 at 05:47:32PM -0700, Darrick J. Wong wrote:
> > > > From: Darrick J. Wong <djwong@kernel.org>
> > > > 
> > > > The exchange-range implementation is now completely separate from the
> > > > old swapext ioctl.  We're deprecating the old swapext ioctl, so let's
> > > > move this test to use exchangerange.
> > > 
> > > Do we really want to lost the swapext test coverage?  Even if it is
> > > deprecated, it will be with us for a long time.  My vote for copy and
> > > pasting this into a new test for exchrange.
> > 
> > Yeah, you're right that we should retain this test for the old swapext
> > ioctl.  I'll fork the test into two -- one for swapext, another for
> > exchangerange.
> 
> ...except that the swapext ioctl doesn't support swapping forks if quota
> is enabled and any of the user/group/project ids are different:
> 
> 
> 	/* User/group/project quota ids must match if quotas are enforced. */
> 	if (XFS_IS_QUOTA_ON(ip->i_mount) &&
> 	    (!uid_eq(VFS_I(ip)->i_uid, VFS_I(tip)->i_uid) ||
> 	     !gid_eq(VFS_I(ip)->i_gid, VFS_I(tip)->i_gid) ||
> 	     ip->i_projid != tip->i_projid))
> 		return -EINVAL;
> 
> I'll amend the commit message:
> 
> "There's no point in maintaining this test for the legacy swapext code
> because it returns EINVAL if any quota is enabled and the two files have
> different user/group/project ids.  Originally I had forward ported the
> old swapext ioctl to use commitrange as its backend, but that will be
> dropped in favor of porting xfs_fsr to use commitrange directly."

Hi Darrick,

I can help to change the patch [4/10] and [10/10] if you need. But for this
one, will you re-send this patch or the whole patchset?

Thanks,
Zorro

> 
> --D
>
Darrick J. Wong June 20, 2024, 7:20 p.m. UTC | #5
On Fri, Jun 21, 2024 at 03:06:28AM +0800, Zorro Lang wrote:
> On Thu, Jun 20, 2024 at 09:55:26AM -0700, Darrick J. Wong wrote:
> > On Wed, Jun 19, 2024 at 10:23:18AM -0700, Darrick J. Wong wrote:
> > > On Tue, Jun 18, 2024 at 11:08:37PM -0700, Christoph Hellwig wrote:
> > > > On Mon, Jun 17, 2024 at 05:47:32PM -0700, Darrick J. Wong wrote:
> > > > > From: Darrick J. Wong <djwong@kernel.org>
> > > > > 
> > > > > The exchange-range implementation is now completely separate from the
> > > > > old swapext ioctl.  We're deprecating the old swapext ioctl, so let's
> > > > > move this test to use exchangerange.
> > > > 
> > > > Do we really want to lost the swapext test coverage?  Even if it is
> > > > deprecated, it will be with us for a long time.  My vote for copy and
> > > > pasting this into a new test for exchrange.
> > > 
> > > Yeah, you're right that we should retain this test for the old swapext
> > > ioctl.  I'll fork the test into two -- one for swapext, another for
> > > exchangerange.
> > 
> > ...except that the swapext ioctl doesn't support swapping forks if quota
> > is enabled and any of the user/group/project ids are different:
> > 
> > 
> > 	/* User/group/project quota ids must match if quotas are enforced. */
> > 	if (XFS_IS_QUOTA_ON(ip->i_mount) &&
> > 	    (!uid_eq(VFS_I(ip)->i_uid, VFS_I(tip)->i_uid) ||
> > 	     !gid_eq(VFS_I(ip)->i_gid, VFS_I(tip)->i_gid) ||
> > 	     ip->i_projid != tip->i_projid))
> > 		return -EINVAL;
> > 
> > I'll amend the commit message:
> > 
> > "There's no point in maintaining this test for the legacy swapext code
> > because it returns EINVAL if any quota is enabled and the two files have
> > different user/group/project ids.  Originally I had forward ported the
> > old swapext ioctl to use commitrange as its backend, but that will be
> > dropped in favor of porting xfs_fsr to use commitrange directly."
> 
> Hi Darrick,
> 
> I can help to change the patch [4/10] and [10/10] if you need. But for this
> one, will you re-send this patch or the whole patchset?

I plan on resending this patchset, since I've found a couple more
swapext tests that need correcting.

--D

> Thanks,
> Zorro
> 
> > 
> > --D
> > 
> 
>
diff mbox series

Patch

diff --git a/tests/generic/710 b/tests/generic/710
index 6c6aa08f63..c344bd898b 100755
--- a/tests/generic/710
+++ b/tests/generic/710
@@ -4,17 +4,17 @@ 
 #
 # FS QA Test No. 710
 #
-# Can we use swapext to exceed the quota enforcement?
+# Can we use exchangerange to exceed the quota enforcement?
 
 . ./common/preamble
-_begin_fstest auto quick fiexchange swapext quota
+_begin_fstest auto quick fiexchange quota
 
 # Import common functions.
 . ./common/filter
 . ./common/quota
 
 # real QA test starts here
-_require_xfs_io_command swapext
+_require_xfs_io_command exchangerange
 _require_user
 _require_nobody
 _require_quota
@@ -35,14 +35,14 @@  chown nobody $SCRATCH_MNT/b
 # Set up a quota limit
 $XFS_QUOTA_PROG -x -c "limit -u bhard=70k nobody" $SCRATCH_MNT
 
-echo before swapext >> $seqres.full
+echo before exchangerange >> $seqres.full
 $XFS_QUOTA_PROG -x -c 'report -a' $SCRATCH_MNT >> $seqres.full
 stat $SCRATCH_MNT/* >> $seqres.full
 
-# Now try to swapext
-$XFS_IO_PROG -c "swapext $SCRATCH_MNT/b" $SCRATCH_MNT/a
+# Now try to exchangerange
+$XFS_IO_PROG -c "exchangerange $SCRATCH_MNT/b" $SCRATCH_MNT/a
 
-echo after swapext >> $seqres.full
+echo after exchangerange >> $seqres.full
 $XFS_QUOTA_PROG -x -c 'report -a' $SCRATCH_MNT >> $seqres.full
 stat $SCRATCH_MNT/* >> $seqres.full
 
diff --git a/tests/generic/710.out b/tests/generic/710.out
index a2aa981919..fcc006c279 100644
--- a/tests/generic/710.out
+++ b/tests/generic/710.out
@@ -1,4 +1,4 @@ 
 QA output created by 710
-swapext: Disk quota exceeded
+exchangerange: Disk quota exceeded
 Comparing user usage
 Comparing group usage