2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Red hat, Inc. All Rights Reserved.
7 # Test racing getxattr requests against large xattr add and remove loop. This
8 # reproduces a bug on XFS where a getxattr of an existing attribute spuriously
9 # returned failure due to races with attribute fork conversion.
12 _begin_fstest auto quick attr
14 # Import common functions.
17 # real QA test starts here
19 # Modify as appropriate.
22 _require_attrs trusted
24 _scratch_mkfs > $seqres.full 2>&1 || _fail "mkfs"
27 # create xattr small enough for local format on XFS
28 touch $SCRATCH_MNT/file
29 $SETFATTR_PROG -n trusted.small -v a $SCRATCH_MNT/file
31 # start a background getxattr loop for the existing xattr
32 runfile="$tmp.getfattr"
34 while [ -e $runfile ]; do
35 _getfattr --absolute-names -n trusted.small $SCRATCH_MNT/file \
40 # while the above is spinning, add and remove a large attribute to cause back
41 # and forth inode attribute fork conversion
42 largeval=`for i in $(seq 0 511); do echo -n a; done`
43 for i in $(seq 0 99); do
44 $SETFATTR_PROG -n trusted.big -v $largeval $SCRATCH_MNT/file
45 $SETFATTR_PROG -x trusted.big $SCRATCH_MNT/file
51 echo Silence is golden