generic/233,270: unlimit the max locked memory size for io_uring
[xfstests-dev.git] / tests / xfs / 094
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 094
6 #
7 # Exercising the inheritable realtime inode bit.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     cd /
21     rm -f $tmp.*
22 }
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs xfs
30 _require_realtime
31 _require_scratch
32
33 _filter_realtime_flag()
34 {
35         _test_inode_flag realtime $SCRATCH_MNT/testdir/$1
36         if [ $? -eq 0 ]; then
37                 echo "--r-- SCRATCH_MNT/testdir/$1"
38         else
39                 echo "----- SCRATCH_MNT/testdir/$1"
40         fi
41 }
42
43 _filter_rtinherit_flag()
44 {
45         _test_inode_flag rt-inherit $SCRATCH_MNT/testdir
46         if [ $? -eq 0 ]; then
47                 echo "--t-- SCRATCH_MNT/testdir"
48         else
49                 echo "----- SCRATCH_MNT/testdir"
50         fi
51 }
52
53 _create_scratch()
54 {
55         echo "*** mkfs"
56         if ! _scratch_mkfs_xfs >$tmp.out 2>&1
57         then
58                 cat $tmp.out
59                 echo "failed to mkfs $SCRATCH_DEV"
60                 exit 1
61         fi
62
63         echo "*** mount"
64         if ! _try_scratch_mount
65         then
66                 echo "failed to mount $SCRATCH_DEV"
67                 exit 1
68         fi
69 }
70
71 _create_scratch
72 mkdir $SCRATCH_MNT/testdir
73
74 # set inode attribute, create files below and check they're marked realtime
75 # unset inode attribute, create files below and check they're not realtime
76
77 echo "*** create directory with rtinherit"
78 $XFS_IO_PROG -r -c 'chattr +t' $SCRATCH_MNT/testdir
79 _filter_rtinherit_flag
80
81 echo "*** create child with inherited realtime"
82 touch $SCRATCH_MNT/testdir/real
83 _filter_realtime_flag real
84
85 echo "*** remove rtinherit from directory"
86 $XFS_IO_PROG -r -c 'chattr -t' $SCRATCH_MNT/testdir
87 _filter_rtinherit_flag
88
89 echo "*** create child without inherited realtime"
90 touch $SCRATCH_MNT/testdir/unreal
91 _filter_realtime_flag unreal
92
93 echo "*** done"
94
95 # success, all done
96 status=0
97 exit