[PATCH v2] generic/432 copy_file_range: add overwrite copy to cover known issue

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



found that follow nfs issue has not been covered by xfstests
 https://bugzilla.redhat.com/show_bug.cgi?id=1803162
 https://bugzilla.redhat.com/show_bug.cgi?id=1803162#c6

add new test to cover it.

test log:
'''
[root@hp-dl360g9-02 xfstests]# DIFF_LENGTH=-0 ./check generic/432
FSTYP         -- nfs
PLATFORM      -- Linux/x86_64 nfsserver 4.18.0-147.el8.x86_64 ...
MKFS_OPTIONS  -- nfsserver:/home/exportdir-xfstests-mh ...
MOUNT_OPTIONS -- -overs=4.2 ...

generic/432 1s ... - output mismatch (see /var/lib/xfstests/results//generic/432.out.bad)
    --- tests/generic/432.out   2020-03-05 03:58:35.946872285 -0500
    +++ /var/lib/xfstests/results//generic/432.out.bad  2020-03-05 03:58:39.519861450 -0500
    @@ -16,6 +16,7 @@
     e11fbace556cba26bf0076e74cab90a3  TEST_DIR/test-432/file
     e5fbacd993eaa5e80ebc2b14b969887d  TEST_DIR/test-432/copy
     Copy overwrite existed copy file
    +cmp: EOF on /mnt/nfsmp-xfstests-mh/test-432/file after byte 5000, in line 1
     md5sums after copying overwrite:
     e11fbace556cba26bf0076e74cab90a3  TEST_DIR/test-432/file
    -e11fbace556cba26bf0076e74cab90a3  TEST_DIR/test-432/copy
    +98ed789264b5b11498bd3f4a70a12916  TEST_DIR/test-432/copy
Ran: generic/432
Failures: generic/432
Failed 1 of 1 tests
'''

BTW: xfs_io copy_range need this commit:
'''
 64e366d9f81785b015b85395060a492d6ae85019
 xfs_io: copy_range don't truncate dst_file, and add smart length
'''

Signed-off-by: Jianhong Yin <yin-jianhong@xxxxxxx>
---

 tests/generic/432     | 7 +++++++
 tests/generic/432.out | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/tests/generic/432 b/tests/generic/432
index 6200af86..762eccae 100755
--- a/tests/generic/432
+++ b/tests/generic/432
@@ -80,6 +80,13 @@ cmp -n 4000 $testdir/file $testdir/copy 1000 3000
 echo "md5sums after copying tail:"
 md5sum $testdir/{file,copy} | _filter_test_dir
 
+echo "Copy overwrite existed copy file"
+$XFS_IO_PROG -t -f -c 'pwrite -S 0x66 0    5000' $testdir/copy >> $seqres.full 2>&1
+$XFS_IO_PROG -f -c "copy_range $testdir/file" "$testdir/copy"
+cmp $testdir/file $testdir/copy
+echo "md5sums after copying overwrite:"
+md5sum $testdir/{file,copy} | _filter_test_dir
+
 #success, all done
 status=0
 exit
diff --git a/tests/generic/432.out b/tests/generic/432.out
index c49d7808..27364728 100644
--- a/tests/generic/432.out
+++ b/tests/generic/432.out
@@ -15,3 +15,7 @@ Copy tail of original file onto copy
 md5sums after copying tail:
 e11fbace556cba26bf0076e74cab90a3  TEST_DIR/test-432/file
 e5fbacd993eaa5e80ebc2b14b969887d  TEST_DIR/test-432/copy
+Copy overwrite existed copy file
+md5sums after copying overwrite:
+e11fbace556cba26bf0076e74cab90a3  TEST_DIR/test-432/file
+e11fbace556cba26bf0076e74cab90a3  TEST_DIR/test-432/copy
-- 
2.18.1




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux