2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Huawei. All Rights Reserved.
7 # This testcase is trying to test recovery flow of generic filesystem, w/ below
8 # steps, once project id changes, after we fsync that file, we can expect that
9 # project id can be recovered after sudden power-cuts.
12 # 2. chattr -p 100 testfile;
13 # 3. xfs_io -f testfile -c "fsync";
20 _begin_fstest shutdown auto quick metadata quota
22 # Import common functions.
26 # real QA test starts here
30 _require_scratch_shutdown
32 _scratch_mkfs >/dev/null 2>&1
33 _require_metadata_journaling $SCRATCH_DEV
34 _qmount_option "prjquota"
36 _require_prjquota $SCRATCH_DEV
39 testfile=$SCRATCH_MNT/testfile
47 if [ "$1" == "sync" ]; then
51 $XFS_IO_PROG -x -c "chproj 100" $testfile
53 before=`$XFS_IO_PROG -x -c "lsproj" $testfile`
55 $XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
57 _scratch_shutdown | tee -a $seqres.full
60 after=`$XFS_IO_PROG -x -c "lsproj" $testfile`
62 # check inode's project quota id
63 if [ "$before" != "$after" ]; then
64 echo "Before: $before"
67 echo "Before: $before" >> $seqres.full
68 echo "After : $after" >> $seqres.full
74 echo "Silence is golden"