Message ID | 171867145344.793463.2045134533110555641.stgit@frogsfrogsfrogs (mailing list archive) |
---|---|
State | Accepted, archived |
Headers | show |
Series | [01/10] misc: split swapext and exchangerange | expand |
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.
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
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
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 >
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 --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