Files
apfstests/common/ceph
T
Luis Henriques 445cbd798b ceph: add a new test for cross quota realms renames
For the moment cross quota realms renames has been disabled in CephFS
after a bug has been found while renaming files created and truncated.
This allowed clients to easily circumvent quotas.

Link: https://tracker.ceph.com/issues/48203
Signed-off-by: Luis Henriques <lhenriques@suse.de>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-12-06 21:00:30 +08:00

31 lines
782 B
Plaintext

#
# CephFS specific common functions.
#
# _ceph_create_file_layout <filename> <stripe unit> <stripe count> <object size>
# This function creates a new empty file and sets the file layout according to
# parameters. It will exit if the file already exists.
_ceph_create_file_layout()
{
local fname=$1
local stripe_unit=$2
local stripe_count=$3
local obj_size=$4
if [ -e $fname ]; then
echo "File $fname already exists."
exit 1
fi
touch $fname
$SETFATTR_PROG -n ceph.file.layout \
-v "stripe_unit=$objsz stripe_count=1 object_size=$objsz" \
$fname
}
# this test requires to access file capabilities through vxattr 'ceph.caps'.
_require_ceph_vxattr_caps()
{
$GETFATTR_PROG -n "ceph.caps" $TEST_DIR >/dev/null 2>&1 \
|| _notrun "ceph.caps vxattr not supported"
}