mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
cf89aed924
Fully scripted conversion, see script in initial SPDX license commit message. Signed-off-by: Dave Chinner <dchinner@redhat.com>
62 lines
1.2 KiB
Bash
Executable File
62 lines
1.2 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2017 CTERA Networks. All Rights Reserved.
|
|
#
|
|
# FS QA Test No. 458
|
|
#
|
|
# Regression test for xfs leftover CoW extents after truncate
|
|
# and umount
|
|
#
|
|
# Fixed by commit 3af423b03435 ("xfs: evict CoW fork extents when performing
|
|
# finsert/fcollapse")
|
|
#
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
here=`pwd`
|
|
tmp=/tmp/$$
|
|
status=1 # failure is the default!
|
|
|
|
_cleanup()
|
|
{
|
|
cd /
|
|
rm -f $tmp.*
|
|
}
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common/rc
|
|
. ./common/filter
|
|
. ./common/reflink
|
|
|
|
# real QA test starts here
|
|
_supported_fs generic
|
|
_supported_os Linux
|
|
_require_scratch_reflink
|
|
_require_cp_reflink
|
|
_require_xfs_io_command "fzero"
|
|
_require_xfs_io_command "fcollapse"
|
|
_require_xfs_io_command "finsert"
|
|
_require_xfs_io_command "truncate"
|
|
|
|
rm -f $seqres.full
|
|
|
|
_scratch_mkfs >/dev/null 2>&1
|
|
_scratch_mount
|
|
|
|
$XFS_IO_PROG -f -c "pwrite 0 0x40000" \
|
|
$SCRATCH_MNT/foo > /dev/null 2>&1
|
|
|
|
_cp_reflink $SCRATCH_MNT/foo $SCRATCH_MNT/bar
|
|
|
|
$XFS_IO_PROG -f -c "fzero -k 0x169f 0x387c" \
|
|
-c "fcollapse 0x29000 0xd000" \
|
|
-c "finsert 0 0x8000" \
|
|
-c "truncate 0x8000" \
|
|
$SCRATCH_MNT/foo > /dev/null 2>&1
|
|
|
|
echo "Silence is golden"
|
|
status=0
|
|
exit
|