2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
7 # Exercising the inheritable realtime inode bit.
10 _begin_fstest metadata dir ioctl auto realtime
12 # Import common functions.
15 # real QA test starts here
20 _filter_realtime_flag()
22 _test_inode_flag realtime $SCRATCH_MNT/testdir/$1
24 echo "--r-- SCRATCH_MNT/testdir/$1"
26 echo "----- SCRATCH_MNT/testdir/$1"
30 _filter_rtinherit_flag()
32 _test_inode_flag rt-inherit $SCRATCH_MNT/testdir
34 echo "--t-- SCRATCH_MNT/testdir"
36 echo "----- SCRATCH_MNT/testdir"
43 if ! _scratch_mkfs_xfs >$tmp.out 2>&1
46 echo "failed to mkfs $SCRATCH_DEV"
51 if ! _try_scratch_mount
53 echo "failed to mount $SCRATCH_DEV"
59 mkdir $SCRATCH_MNT/testdir
61 # set inode attribute, create files below and check they're marked realtime
62 # unset inode attribute, create files below and check they're not realtime
64 echo "*** create directory with rtinherit"
65 $XFS_IO_PROG -r -c 'chattr +t' $SCRATCH_MNT/testdir
66 _filter_rtinherit_flag
68 echo "*** create child with inherited realtime"
69 touch $SCRATCH_MNT/testdir/real
70 _filter_realtime_flag real
72 echo "*** remove rtinherit from directory"
73 $XFS_IO_PROG -r -c 'chattr -t' $SCRATCH_MNT/testdir
74 _filter_rtinherit_flag
76 echo "*** create child without inherited realtime"
77 touch $SCRATCH_MNT/testdir/unreal
78 _filter_realtime_flag unreal