2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2016 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test that if we rename a file, without changing its parent directory, create
8 # a new file that has the old name of the file we renamed, doing an fsync
9 # against the file we renamed works correctly and after a power failure both
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
31 # real QA test starts here
35 _require_dm_target flakey
39 _scratch_mkfs >>$seqres.full 2>&1
40 _require_metadata_journaling $SCRATCH_DEV
44 # Create our test directories and files.
45 mkdir $SCRATCH_MNT/dir
46 touch $SCRATCH_MNT/dir/foo
47 # Make sure everything is durably persisted.
49 mv $SCRATCH_MNT/dir/foo $SCRATCH_MNT/dir/bar
50 touch $SCRATCH_MNT/dir/foo
51 $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/dir/bar
53 _flakey_drop_and_remount
55 echo "Filesystem contents after log replay:"
56 ls -R $SCRATCH_MNT/dir | _filter_scratch