fstests: check for filesystem FS_IOC_FSSETXATTR support
[xfstests-dev.git] / tests / xfs / 177
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 177
6 #
7 # Test to reproduce PV#: 964316
8 # Check sync reclaims and flushes unlinked inodes to their buffers.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21     cd /
22     rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/dmapi
29
30 # real QA test starts here
31
32 # Modify as appropriate.
33 _supported_fs xfs 
34 _supported_os Linux
35
36 # Setup Filesystem
37 _require_scratch
38
39 # test that we have DMAPI support
40 _dmapi_scratch_mount
41 _scratch_unmount > /dev/null 2>&1
42
43 _scratch_mkfs_xfs >/dev/null 2>&1 \
44         || _fail "mkfs failed"
45
46 _scratch_mount
47
48 # run Mark Goodwin test here
49 # Usage: ./bulkstat_unlink_test iterations nfiles stride dir
50 #        Create dir with nfiles, unlink each stride'th file, sync, bulkstat
51 echo "Start original bulkstat_unlink_test"
52 $here/src/bulkstat_unlink_test 10 100 1 $SCRATCH_MNT/bulkstat
53 $here/src/bulkstat_unlink_test 10 1000 1 $SCRATCH_MNT/bulkstat
54 $here/src/bulkstat_unlink_test 15 100 6 $SCRATCH_MNT/bulkstat
55 $here/src/bulkstat_unlink_test 20 1000 3 $SCRATCH_MNT/bulkstat
56
57 # Mount scratch with ikeep enabled
58 _scratch_unmount
59 _scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT"
60
61 echo "Start bulkstat_unlink_test_modified"
62 $here/src/bulkstat_unlink_test_modified 10 1000 1 $SCRATCH_MNT/bulkstat
63
64 # success, all done
65 status=0
66 exit