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
31 _require_scratch_shutdown
33 _scratch_mkfs >/dev/null 2>&1
34 _scratch_enable_pquota
35 _require_metadata_journaling $SCRATCH_DEV
36 _qmount_option "prjquota"
38 _require_prjquota $SCRATCH_DEV
41 testfile=$SCRATCH_MNT/testfile
49 if [ "$1" == "sync" ]; then
53 $XFS_IO_PROG -x -c "chproj 100" $testfile
55 before=`$XFS_IO_PROG -x -c "lsproj" $testfile`
57 $XFS_IO_PROG -f $testfile -c "fsync" | _filter_xfs_io
59 _scratch_shutdown | tee -a $seqres.full
62 after=`$XFS_IO_PROG -x -c "lsproj" $testfile`
64 # check inode's project quota id
65 if [ "$before" != "$after" ]; then
66 echo "Before: $before"
69 echo "Before: $before" >> $seqres.full
70 echo "After : $after" >> $seqres.full
76 echo "Silence is golden"