2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Red Hat, Inc. All Rights Reserved.
7 # Test orphan inode / unlinked list processing on RO mount & RW transition
9 # A filesystem that crashes with open but unlinked inodes should
10 # be consistent after a ro, ro->rw, or rw mount cycle.
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
34 # real QA test starts here
38 _require_scratch_shutdown
39 _require_metadata_journaling $SCRATCH_DEV
40 _require_test_program "multi_open_unlink"
43 function create_dirty_orphans() {
51 # sleep for ages and we will kill this pid when we are ready
54 echo "open and unlink $num_files files with EAs"
55 $here/src/multi_open_unlink -f $SCRATCH_MNT/test_file \
56 -n $num_files -s $delay -e $num_eas -v $ea_val_size &
59 # time to create and unlink all the files
63 _scratch_shutdown -v -f >> $seqres.full
65 # kill the multi_open_unlink
73 # Does a regular rw mount handle the orphan list?
74 echo "mount dirty orphans rw, then unmount"
78 # We should be clean at this point
79 echo "check fs consistency"
82 # Does a ro mount handle the orphan list?
83 echo "mount dirty orphans ro, then unmount"
87 # We should be clean at this point
88 echo "check fs consistency"
91 # Does a mount with ro->rw transition handle orphan list?
92 echo "mount dirty orphans ro and remount rw, then unmount"
97 # We should be clean at this point
98 echo "check fs consistency"