4 # Test orphan inode / unlinked list processing on RO mount & RW transition
6 # A filesystem that crashes with open but unlinked inodes should
7 # be consistent after a ro, ro->rw, or rw mount cycle.
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2017 Red Hat, Inc. All Rights Reserved.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
42 # get standard environment, filters and checks
46 # remove previous $seqres.full before test
49 # real QA test starts here
53 _require_scratch_shutdown
54 _require_metadata_journaling $SCRATCH_DEV
55 _require_test_program "multi_open_unlink"
58 function create_dirty_orphans() {
66 # sleep for ages and we will kill this pid when we are ready
69 echo "open and unlink $num_files files with EAs"
70 src/multi_open_unlink -f $SCRATCH_MNT/test_file \
71 -n $num_files -s $delay -e $num_eas -v $ea_val_size &
74 # time to create and unlink all the files
78 _scratch_shutdown -v -f >> $seqres.full
80 # kill the multi_open_unlink
88 # Does a regular rw mount handle the orphan list?
89 echo "mount dirty orphans rw, then unmount"
93 # We should be clean at this point
94 echo "check fs consistency"
97 # Does a ro mount handle the orphan list?
98 echo "mount dirty orphans ro, then unmount"
102 # We should be clean at this point
103 echo "check fs consistency"
106 # Does a mount with ro->rw transition handle orphan list?
107 echo "mount dirty orphans ro and remount rw, then unmount"
112 # We should be clean at this point
113 echo "check fs consistency"