2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle. All Rights Reserved.
7 # Ensure that we can XATTR_REPLACE a tiny attr into a large attr.
8 # Kanda Motohiro <kanda.motohiro@gmail.com> reports that XATTR_REPLACE'ing
9 # a single-byte attr with a 2048-byte attr causes a fs shutdown because we
10 # remove the shortform attr, convert the attr fork to long format, and then
11 # try to re-add the attr having not cleared ATTR_REPLACE.
13 # Commit 7b38460dc8e4 ("xfs: don't fail when converting shortform attr to long
14 # form during ATTR_REPLACE") fixed the xfs bug.
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
21 status=1 # failure is the default!
22 trap "_cleanup; exit \$status" 0 1 2 3 15
30 # get standard environment, filters and checks
35 # remove previous $seqres.full before test
38 # real QA test starts here
40 _require_test_program "attr_replace_test"
45 _scratch_mkfs >>$seqres.full 2>&1
46 _scratch_mount >>$seqres.full 2>&1
48 filter_attr_output() {
49 _filter_scratch | grep world | \
50 sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
53 $here/src/attr_replace_test $SCRATCH_MNT/hello
54 $ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
55 $ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output