Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # SPDX-License-Identifier: GPL-2.0
- # Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
- #
- # FSQA Test No. XXX
- #
- # TODO description
- #
- seq=`basename $0`
- seqres=$RESULT_DIR/$seq
- echo "QA output created by $seq"
- tmp=/tmp/$$
- status=1 # failure is the default!
- trap "_cleanup; exit \$status" 0 1 2 3 15
- _cleanup()
- {
- _cleanup_flakey
- cd /
- rm -f $tmp.*
- }
- # get standard environment, filters and checks
- . ./common/rc
- . ./common/attr
- . ./common/filter
- . ./common/dmflakey
- # real QA test starts here
- _supported_fs btrfs
- _supported_os Linux
- _require_scratch
- _require_dm_target flakey
- _require_btrfs_fs_feature "no_holes"
- _require_btrfs_mkfs_feature "no-holes"
- _require_xfs_io_command "sync_range"
- rm -f $seqres.full
- _scratch_mkfs -O ^no-holes >>$seqres.full 2>&1
- _require_metadata_journaling $SCRATCH_DEV
- _init_flakey
- _mount_flakey
- touch $SCRATCH_MNT/foo
- # Clear the full sync bit, so that the msync below triggers the fast fsync path.
- $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/foo
- # get rid of the log tree
- sync
- # Dirty some pages and flush only some of them at the beginning without updating
- # the log tree.
- $XFS_IO_PROG -c "pwrite -S 0xab 0 1M" \
- -c "sync_range -abw 0 256K" \
- $SCRATCH_MNT/foo >>$seqres.full
- $XFS_IO_PROG \
- -c "mmap -w 512K 512K" \
- -c "mwrite -S 0xcd 512K 512K" \
- -c "msync -s 512K 512K" \
- -c "munmap" \
- $SCRATCH_MNT/foo >>$seqres.full
- _flakey_drop_and_remount
- _unmount_flakey
- # On exit fsck is run and reports missing file extent for range from 0 to 512Kb.
- status=0
- exit
RAW Paste Data