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
34 _require_dm_target flakey
38 _scratch_mkfs >>$seqres.full 2>&1
39 _require_metadata_journaling $SCRATCH_DEV
43 # Create our test directories and files.
44 mkdir $SCRATCH_MNT/dir
45 touch $SCRATCH_MNT/dir/foo
46 # Make sure everything is durably persisted.
48 mv $SCRATCH_MNT/dir/foo $SCRATCH_MNT/dir/bar
49 touch $SCRATCH_MNT/dir/foo
50 $XFS_IO_PROG -c "fsync" $SCRATCH_MNT/dir/bar
52 _flakey_drop_and_remount
54 echo "Filesystem contents after log replay:"
55 ls -R $SCRATCH_MNT/dir | _filter_scratch