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 _begin_fstest auto quick attr
19 # Override the default cleanup function.
26 # Import common functions.
30 # real QA test starts here
32 _require_test_program "attr_replace_test"
36 _scratch_mkfs >>$seqres.full 2>&1
37 _scratch_mount >>$seqres.full 2>&1
39 filter_attr_output() {
40 _filter_scratch | grep world | \
41 sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
44 $here/src/attr_replace_test $SCRATCH_MNT/hello
45 $ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
46 $ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output