Skip to contentSkip to conversation

fstests: test adjustments for the reflink behavior change

PATCH In review Josef Bacik 2 participants 5 messages Mar 11, 2022 – Mar 14, 2022 Btrfs file system

lore
Share & tools
lore
#0 lore raw

cover fstests: test adjustments for the reflink behavior change

Hello,

The cross-vfsmount reflink restriction is being lifted, and as such these tests are no longer valid. I've had these patches in the btrfs staging branch for a few weeks so they've been thoroughly tested. Thanks,

Josef

Josef Bacik (2):
fstests: delete the cross-vfsmount reflink tests
fstests: btrfs/029: delete the cross vfsmount checks

 tests/btrfs/029       |  9 +-----
 tests/btrfs/029.out   |  6 ----
 tests/generic/373     | 70 -------------------------------------------
 tests/generic/373.out |  9 ------
 tests/generic/374     | 68 -----------------------------------------
 tests/generic/374.out | 10 -------
 6 files changed, 1 insertion(+), 171 deletions(-)
 delete mode 100755 tests/generic/373
 delete mode 100644 tests/generic/373.out
 delete mode 100755 tests/generic/374
 delete mode 100644 tests/generic/374.out
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/2 fstests: delete the cross-vfsmount reflink tests

Cross vfsmount reflink's are now allowed, the patch is in linux-next and will go to linus soon. Remove these tests so nobody freaks out when they start failing.

---
 tests/generic/373     | 70 -------------------------------------------
 tests/generic/373.out |  9 ------
 tests/generic/374     | 68 -----------------------------------------
 tests/generic/374.out | 10 -------
 4 files changed, 157 deletions(-)
 delete mode 100755 tests/generic/373
 delete mode 100644 tests/generic/373.out
 delete mode 100755 tests/generic/374
 delete mode 100644 tests/generic/374.out
tests/generic/373 deleted +0 -70
deleted file mode 100755
index 2f68b24f..00000000
@@ -1,70 +0,0 @@
-#! /bin/bash
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (c) 2016 Oracle, Inc.  All Rights Reserved.
-#
-# FS QA Test No. 373
-#
-# Check that cross-mountpoint reflink doesn't work.
-#
-. ./common/preamble
-_begin_fstest auto quick clone
-
-_register_cleanup "_cleanup" BUS
-
-# Override the default cleanup function.
-_cleanup()
-{
-	cd /
-	rm -rf $tmp.*
-	wait
-}
-
-# Import common functions.
-. ./common/filter
-. ./common/reflink
-
-# real QA test starts here
-_supported_fs generic
-_require_scratch_reflink
-_require_cp_reflink
-
-echo "Format and mount"
-_scratch_mkfs > $seqres.full 2>&1
-_scratch_mount >> $seqres.full 2>&1
-
-testdir=$SCRATCH_MNT/test-$seq
-mkdir $testdir
-otherdir=/tmp/m.$seq
-othertestdir=$otherdir/test-$seq
-rm -rf $otherdir
-mkdir $otherdir
-
-blocks=1
-blksz=65536
-sz=$((blksz * blocks))
-
-echo "Mount otherdir"
-$MOUNT_PROG --bind $SCRATCH_MNT $otherdir
-
-echo "Create file"
-_pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
-
-filter_md5()
-{
-	_filter_scratch | sed -e "s,$otherdir,OTHER_DIR,g"
-}
-
-echo "Reflink one file to another"
-_cp_reflink $testdir/file $othertestdir/otherfiles 2>&1 | filter_md5
-
-echo "Check output"
-md5sum $testdir/file | _filter_scratch
-test -e $othertestdir/otherfile && echo "otherfile should not exist"
-
-echo "Unmount otherdir"
-$UMOUNT_PROG $otherdir
-rm -rf $otherdir
-
-# success, all done
-status=0
-exit
tests/generic/373.out deleted +0 -9
deleted file mode 100644
index 60f280fc..00000000
@@ -1,9 +0,0 @@
-QA output created by 373
-Format and mount
-Mount otherdir
-Create file
-Reflink one file to another
-cp: failed to clone 'OTHER_DIR/test-373/otherfiles' from 'SCRATCH_MNT/test-373/file': Invalid cross-device link
-Check output
-2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-373/file
-Unmount otherdir
tests/generic/374 deleted +0 -68

68 lines not on this page · raw message

tests/generic/374.out deleted +0 -10
deleted file mode 100644
index 3243ad3d..00000000
@@ -1,10 +0,0 @@
-QA output created by 374
-Format and mount
-Mount otherdir
-Create file
-Dedupe one file to another
-XFS_IOC_FILE_EXTENT_SAME: Invalid cross-device link
-Check output
-2d61aa54b58c2e94403fb092c3dbc027  SCRATCH_MNT/test-374/file
-2d61aa54b58c2e94403fb092c3dbc027  OTHER_DIR/test-374/otherfile
-Unmount otherdir
Signature · 1 line
2.26.3
#2 lore raw

Re: [PATCH 1/2] fstests: delete the cross-vfsmount reflink tests

Quoted 5 lines · Josef Bacik

Cross vfsmount reflink's are now allowed, the patch is in linux-next and will go to linus soon. Remove these tests so nobody freaks out when they start failing.

Shouldn't these tests be converted to test that cross-vfsmount reflinks now actually work?

i.e. it's all well and good to remove tests of behaviour we no longer enforce, but to then not test the new behaviour we allow is actually working properly....

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#3 lore raw

Re: [PATCH 1/2] fstests: delete the cross-vfsmount reflink tests

Quoted 5 lines · Dave Chinner
Quoted 4 lines · Josef Bacik

Cross vfsmount reflink's are now allowed, the patch is in linux-next and will go to linus soon. Remove these tests so nobody freaks out when they start failing.

Quoted 9 lines
Quoted 1 line

Shouldn't these tests be converted to test that cross-vfsmount reflinks now actually work?

i.e. it's all well and good to remove tests of behaviour we no longer enforce, but to then not test the new behaviour we allow is actually working properly....

Sure, I'll fix it up and run it through a night of our CI tests and then send the updated patches. Thanks,

Josef

#4 lore raw

PATCH 2/2 fstests: btrfs/029: delete the cross vfsmount checks

In reply to Josef Bacik

We now allow cross vfsmount reflinks, remove this portion of the test from btrfs/029.

---
 tests/btrfs/029     | 9 +--------
 tests/btrfs/029.out | 6 ------
 2 files changed, 1 insertion(+), 14 deletions(-)
tests/btrfs/029 +1 -8
index 1bdbc951..26ca8938 100755
@@ -5,8 +5,7 @@
 # FS QA Test No. 029
 #
 # Check if creating a sparse copy ("reflink") of a file on btrfs
-# expectedly fails when it's done between different filesystems or
-# different mount points of the same filesystem.
+# expectedly fails when it's done between different filesystems.
 #
 # For both situations, these actions are executed:
 #    - Copy a file with the reflink=auto option.
@@ -59,12 +58,6 @@ _create_reflinks()
 echo "test reflinks across different devices"
 _create_reflinks $SCRATCH_MNT/original $reflink_test_dir/copy
 
-echo "test reflinks across different mountpoints of same device"
-rm -rf $reflink_test_dir/*
-_mount $SCRATCH_DEV $reflink_test_dir
-_create_reflinks $SCRATCH_MNT/original $reflink_test_dir/copy
-$UMOUNT_PROG $reflink_test_dir
-
 # success, all done
 status=0
 exit
tests/btrfs/029.out +0 -6
index f1c88780..93044342 100644
@@ -5,9 +5,3 @@ reflink=auto:
 42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-029/copy
 reflink=always:
 cp reflink failed
-test reflinks across different mountpoints of same device
-reflink=auto:
-42d69d1a6d333a7ebdf64792a555e392  SCRATCH_MNT/original
-42d69d1a6d333a7ebdf64792a555e392  TEST_DIR/test-029/copy
-reflink=always:
-cp reflink failed
Signature · 1 line
2.26.3