Files
apfstests/tests/ceph/002
T
Darrick J. Wong 7e98d41a6e fstests: move test group info to test files
Refactor every test in the entire test suite to use the new boilerplate
functions.  This also migrates all the test group information into the
test files.  This patch has been autogenerated via the command:

./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2021-06-27 22:50:02 +08:00

66 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
#
# FS QA Test No. ceph/002
#
# Test bug found while testing copy_file_range.
#
# This bug was an issue with how the OSDs handled the truncate_seq, copying it
# from the original object into the destination object. This test ensures the
# kernel client correctly handles fixed/non-fixed OSDs.
#
# The bug was tracked here:
#
# https://tracker.ceph.com/issues/37378
#
# The most relevant commits are:
#
# ceph OSD: dcd6a99ef9f5 ("osd: add new 'copy-from2' operation")
# linux kernel: 78beb0ff2fec ("ceph: use copy-from2 op in copy_file_range")
#
. ./common/preamble
_begin_fstest auto quick copy
# get standard environment
. common/filter
. common/attr
# real QA test starts here
_supported_fs ceph
_require_xfs_io_command "copy_range"
_require_attrs
_require_test
workdir=$TEST_DIR/test-$seq
rm -rf $workdir
mkdir $workdir
# Use 4M object size
objsz=4194304
file="$workdir/file-$objsz"
dest="$workdir/dest-$objsz"
# object_size has to be a multiple of stripe_unit
_ceph_create_file_layout $file $objsz 1 $objsz
_ceph_create_file_layout $dest $objsz 1 $objsz
# Create a 3 objects size files
$XFS_IO_PROG -c "pwrite -S 0x61 0 $objsz" $file >> $seqres.full 2>&1
$XFS_IO_PROG -c "pwrite -S 0x62 $objsz $objsz" $file >> $seqres.full 2>&1
$XFS_IO_PROG -c "pwrite -S 0x63 $(($objsz * 2)) $objsz" $file >> $seqres.full 2>&1
$XFS_IO_PROG -c "pwrite -S 0x64 0 $(($objsz * 3))" $dest >> $seqres.full 2>&1
# Truncate the destination file (messing up with the truncate_seq)
$XFS_IO_PROG -c "truncate 0" $dest >> $seqres.full 2>&1
# copy the whole file over
$XFS_IO_PROG -c "copy_range -s 0 -d 0 -l $(($objsz * 3)) $file" "$dest"
hexdump $dest
#success, all done
status=0
exit