mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs: inject errors at various parts of the deferred op completion
Use the error injection mechanism to test log recovery of deferred work. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
committed by
Eryu Guan
parent
219d4cdcb6
commit
872ccc54ca
Executable
+102
@@ -0,0 +1,102 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 312
|
||||
#
|
||||
# Reflink a file with a few dozen extents, CoW a few blocks, and rm.
|
||||
# Inject an error during block remap to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_xfs_io_error_injection "bmap_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3
|
||||
|
||||
# Punch holes in file3
|
||||
seq 1 2 $blks | while read off; do
|
||||
$XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full
|
||||
done
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "bmap_finish_one"
|
||||
|
||||
echo "CoW a few blocks"
|
||||
$XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz $((10 * blksz)) $((10 * blksz))" $SCRATCH_MNT/file2 >> $seqres.full
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Check files again"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,18 @@
|
||||
QA output created by 312
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Inject error
|
||||
CoW a few blocks
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
FS should be online, touch should succeed
|
||||
Check files again
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
1e108771fba35e2f2961d1ad23efbff7 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Done
|
||||
Executable
+102
@@ -0,0 +1,102 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 313
|
||||
#
|
||||
# Reflink a file with a few dozen extents, CoW a few blocks, and rm.
|
||||
# Inject an error during refcount updates to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_xfs_io_error_injection "refcount_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3
|
||||
|
||||
# Punch holes in file3
|
||||
seq 1 2 $blks | while read off; do
|
||||
$XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full
|
||||
done
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "refcount_finish_one"
|
||||
|
||||
echo "CoW a few blocks"
|
||||
$XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz $((10 * blksz)) $((10 * blksz))" $SCRATCH_MNT/file2 >> $seqres.full
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Check files again"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,18 @@
|
||||
QA output created by 313
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Inject error
|
||||
CoW a few blocks
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
FS should be online, touch should succeed
|
||||
Check files again
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Done
|
||||
Executable
+106
@@ -0,0 +1,106 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 314
|
||||
#
|
||||
# Reflink a file with a few dozen extents, CoW a few blocks, and rm.
|
||||
# Inject an error during rmap updates to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_error_injection
|
||||
_require_xfs_io_error_injection "rmap_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
|
||||
test $is_rmap -gt 0 || _notrun "rmap not supported on scratch fs"
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3
|
||||
|
||||
# Punch holes in file3
|
||||
seq 1 2 $blks | while read off; do
|
||||
$XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full
|
||||
done
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "rmap_finish_one"
|
||||
|
||||
echo "CoW a few blocks"
|
||||
$XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz $((10 * blksz)) $((10 * blksz))" $SCRATCH_MNT/file2 >> $seqres.full
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Check files again"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,18 @@
|
||||
QA output created by 314
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Inject error
|
||||
CoW a few blocks
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
FS should be online, touch should succeed
|
||||
Check files again
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Done
|
||||
Executable
+99
@@ -0,0 +1,99 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 315
|
||||
#
|
||||
# Reflink a file with a few dozen extents and CoW a few blocks.
|
||||
# Inject an error during extent freeing to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_error_injection
|
||||
_require_xfs_io_error_injection "free_extent"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=4
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
$XFS_IO_PROG -c "cowextsize $sz" $SCRATCH_MNT
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_pwrite_byte 0x66 $((sz / 2)) $((sz / 2)) $SCRATCH_MNT/file2 >> $seqres.full
|
||||
_reflink_range $SCRATCH_MNT/file1 0 $SCRATCH_MNT/file2 0 $((sz / 2)) >> $seqres.full
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "free_extent"
|
||||
|
||||
echo "CoW a few blocks"
|
||||
$XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full
|
||||
sync
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Check files again"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,16 @@
|
||||
QA output created by 315
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
cf41e243bf211225660f3fabe6db9eb6 SCRATCH_MNT/file1
|
||||
cf41e243bf211225660f3fabe6db9eb6 SCRATCH_MNT/file2
|
||||
Inject error
|
||||
CoW a few blocks
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
FS should be online, touch should succeed
|
||||
Check files again
|
||||
fe9070b9c9deb97ed53811efda5c4ad5 SCRATCH_MNT/file1
|
||||
cf41e243bf211225660f3fabe6db9eb6 SCRATCH_MNT/file2
|
||||
Done
|
||||
Executable
+100
@@ -0,0 +1,100 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 316
|
||||
#
|
||||
# Reflink a file with a few dozen extents, CoW a few blocks, and rm.
|
||||
# Force XFS into "two refcount updates per transaction" mode.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_error_injection
|
||||
_require_xfs_io_error_injection "refcount_continue_update"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3
|
||||
|
||||
# Punch holes in file3
|
||||
seq 1 2 $blks | while read off; do
|
||||
$XFS_IO_PROG -c "fpunch $((off * blksz)) $blksz" $SCRATCH_MNT/file3 >> $seqres.full
|
||||
done
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "refcount_continue_update"
|
||||
|
||||
echo "CoW all the blocks"
|
||||
$XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $((blks * blksz))" $SCRATCH_MNT/file2 >> $seqres.full
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Check files again"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,16 @@
|
||||
QA output created by 316
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Inject error
|
||||
CoW all the blocks
|
||||
Remount to replay log
|
||||
FS should be online, touch should succeed
|
||||
Check files again
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
4155b81ac6d45c0182fa2bc03960f230 SCRATCH_MNT/file2
|
||||
153498e22f8ff52d7f60b466a5e65285 SCRATCH_MNT/file3
|
||||
Done
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 317
|
||||
#
|
||||
# Simulate rmap update errors with a file write and a file remove.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_scratch
|
||||
_require_error_injection
|
||||
_require_xfs_io_error_injection "rmap_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
is_rmap=$(xfs_info $SCRATCH_MNT | grep -c "rmapbt=1")
|
||||
test $is_rmap -gt 0 || _notrun "rmap not supported on scratch fs"
|
||||
|
||||
echo "Create files"
|
||||
touch $SCRATCH_MNT/file1
|
||||
_pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file0 >> $seqres.full
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file0 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "rmap_finish_one"
|
||||
|
||||
echo "Write files"
|
||||
$XFS_IO_PROG -c "pwrite -W -S 0x67 -b $sz 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file0 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,16 @@
|
||||
QA output created by 317
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
4155b81ac6d45c0182fa2bc03960f230 SCRATCH_MNT/file0
|
||||
d41d8cd98f00b204e9800998ecf8427e SCRATCH_MNT/file1
|
||||
Inject error
|
||||
Write files
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
Check files
|
||||
4155b81ac6d45c0182fa2bc03960f230 SCRATCH_MNT/file0
|
||||
d41d8cd98f00b204e9800998ecf8427e SCRATCH_MNT/file1
|
||||
FS should be online, touch should succeed
|
||||
Done
|
||||
Executable
+93
@@ -0,0 +1,93 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 318
|
||||
#
|
||||
# Simulate free extent errors with a file write and a file remove.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_scratch
|
||||
_require_error_injection
|
||||
_require_xfs_io_error_injection "rmap_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
touch $SCRATCH_MNT/file1
|
||||
|
||||
echo "Write files"
|
||||
$XFS_IO_PROG -c "pwrite -S 0x67 0 $sz" $SCRATCH_MNT/file1 >> $seqres.full
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 2>&1 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "free_extent"
|
||||
|
||||
echo "Remove files"
|
||||
rm -rf $SCRATCH_MNT/file1
|
||||
sync
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 2>&1 | _filter_scratch
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,15 @@
|
||||
QA output created by 318
|
||||
Format filesystem
|
||||
Create files
|
||||
Write files
|
||||
Check files
|
||||
4155b81ac6d45c0182fa2bc03960f230 SCRATCH_MNT/file1
|
||||
Inject error
|
||||
Remove files
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
Check files
|
||||
md5sum: SCRATCH_MNT/file1: No such file or directory
|
||||
FS should be online, touch should succeed
|
||||
Done
|
||||
Executable
+97
@@ -0,0 +1,97 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 319
|
||||
#
|
||||
# Reflink a file.
|
||||
# Inject an error during block remap to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_xfs_io_error_injection "bmap_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
|
||||
_pwrite_byte 0x67 0 $sz $SCRATCH_MNT/file3 >> $seqres.full
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "bmap_finish_one"
|
||||
|
||||
echo "Try to reflink"
|
||||
_reflink_range $SCRATCH_MNT/file1 0 $SCRATCH_MNT/file3 0 $sz >> $seqres.full
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,19 @@
|
||||
QA output created by 319
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
4155b81ac6d45c0182fa2bc03960f230 SCRATCH_MNT/file3
|
||||
Inject error
|
||||
Try to reflink
|
||||
XFS_IOC_CLONE_RANGE: Input/output error
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file2
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file3
|
||||
FS should be online, touch should succeed
|
||||
Done
|
||||
Executable
+95
@@ -0,0 +1,95 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 320
|
||||
#
|
||||
# Reflink a file.
|
||||
# Inject an error during block remap to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_xfs_io_error_injection "bmap_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks - 17))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file2
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "bmap_finish_one"
|
||||
|
||||
echo "Try to reflink"
|
||||
_cp_reflink $SCRATCH_MNT/file1 $SCRATCH_MNT/file3 2>&1 | _filter_scratch
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file2 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,18 @@
|
||||
QA output created by 320
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
a98e7df2a7a456009a493e47411c58d1 SCRATCH_MNT/file1
|
||||
a98e7df2a7a456009a493e47411c58d1 SCRATCH_MNT/file2
|
||||
Inject error
|
||||
Try to reflink
|
||||
cp: failed to clone 'SCRATCH_MNT/file3' from 'SCRATCH_MNT/file1': Input/output error
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
Check files
|
||||
a98e7df2a7a456009a493e47411c58d1 SCRATCH_MNT/file1
|
||||
a98e7df2a7a456009a493e47411c58d1 SCRATCH_MNT/file2
|
||||
a98e7df2a7a456009a493e47411c58d1 SCRATCH_MNT/file3
|
||||
FS should be online, touch should succeed
|
||||
Done
|
||||
Executable
+94
@@ -0,0 +1,94 @@
|
||||
#! /bin/bash
|
||||
# FS QA Test No. 321
|
||||
#
|
||||
# Reflink a file.
|
||||
# Inject an error during refcount update to test log recovery.
|
||||
#
|
||||
#-----------------------------------------------------------------------
|
||||
# Copyright (c) 2016, Oracle and/or its affiliates. All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it would be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write the Free Software Foundation,
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
seq=`basename $0`
|
||||
seqres=$RESULT_DIR/$seq
|
||||
echo "QA output created by $seq"
|
||||
|
||||
here=`pwd`
|
||||
tmp=/tmp/$$
|
||||
status=1 # failure is the default!
|
||||
trap "_cleanup; exit \$status" 0 1 2 3 15
|
||||
|
||||
_cleanup()
|
||||
{
|
||||
cd /
|
||||
_scratch_unmount > /dev/null 2>&1
|
||||
rm -rf $tmp.*
|
||||
}
|
||||
|
||||
# get standard environment, filters and checks
|
||||
. ./common/rc
|
||||
. ./common/filter
|
||||
. ./common/reflink
|
||||
. ./common/inject
|
||||
|
||||
# real QA test starts here
|
||||
_supported_os Linux
|
||||
_supported_fs xfs
|
||||
_require_cp_reflink
|
||||
_require_scratch_reflink
|
||||
_require_xfs_io_error_injection "refcount_finish_one"
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
blksz=65536
|
||||
blks=64
|
||||
sz=$((blksz * blks))
|
||||
echo "Format filesystem"
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount >> $seqres.full
|
||||
|
||||
echo "Create files"
|
||||
_pwrite_byte 0x66 0 $sz $SCRATCH_MNT/file1 >> $seqres.full
|
||||
$XFS_IO_PROG -f -c "truncate $sz" $SCRATCH_MNT/file3 >> $seqres.full
|
||||
sync
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "Inject error"
|
||||
_scratch_inject_error "refcount_finish_one"
|
||||
|
||||
echo "Try to reflink"
|
||||
_reflink_range $SCRATCH_MNT/file1 0 $SCRATCH_MNT/file3 0 $sz >> $seqres.full
|
||||
|
||||
echo "FS should be shut down, touch will fail"
|
||||
touch $SCRATCH_MNT/badfs 2>&1 | _filter_scratch
|
||||
|
||||
echo "Remount to replay log"
|
||||
_scratch_inject_logprint >> $seqres.full
|
||||
|
||||
echo "Check files"
|
||||
md5sum $SCRATCH_MNT/file1 | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/file3 | _filter_scratch
|
||||
|
||||
echo "FS should be online, touch should succeed"
|
||||
touch $SCRATCH_MNT/goodfs
|
||||
|
||||
echo "Done"
|
||||
|
||||
# success, all done
|
||||
status=0
|
||||
exit
|
||||
@@ -0,0 +1,17 @@
|
||||
QA output created by 321
|
||||
Format filesystem
|
||||
Create files
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
b5cfa9d6c8febd618f91ac2843d50a1c SCRATCH_MNT/file3
|
||||
Inject error
|
||||
Try to reflink
|
||||
XFS_IOC_CLONE_RANGE: Input/output error
|
||||
FS should be shut down, touch will fail
|
||||
touch: cannot touch 'SCRATCH_MNT/badfs': Input/output error
|
||||
Remount to replay log
|
||||
Check files
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file1
|
||||
2a4f043bf9730a9e8882c9264b9797b3 SCRATCH_MNT/file3
|
||||
FS should be online, touch should succeed
|
||||
Done
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user