2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2021 CTERA Networks. All Rights Reserved.
5 # Check that directory modifications to an open dir are observed
9 seqres=$RESULT_DIR/$seq
10 echo "QA output created by $seq"
14 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
23 # get standard environment, filters and checks
27 # real QA test starts here
33 testdir=$TEST_DIR/test-$seq
37 # Use small getdents bufsize to fit less than 10 entries
38 # stuct linux_dirent64 is 20 bytes not including d_name
41 # Check readdir content of an empty dir changes when adding a new file
42 echo -e "\nCreate file 0 in an open dir:" >> $seqres.full
43 $here/src/t_dir_offset2 $testdir $bufsize "+0" 2>&1 >> $seqres.full || \
44 echo "Missing created file in open dir (see $seqres.full for details)"
46 # Create enough files to be returned in multiple gendents() calls.
47 # At least one of the files that we delete will not be listed in the
48 # first call, so we may encounter stale entries in following calls.
53 # Check readdir content changes after removing files
55 echo -e "\nRemove file ${n}0 in an open dir:" >> $seqres.full
56 $here/src/t_dir_offset2 $testdir $bufsize "-${n}0" 2>&1 >> $seqres.full || \
57 echo "Found unlinked files in open dir (see $seqres.full for details)"
61 echo "Silence is golden"