4 # Ensure that we can XATTR_REPLACE a tiny attr into a large attr.
5 # Kanda Motohiro <kanda.motohiro@gmail.com> reports that XATTR_REPLACE'ing
6 # a single-byte attr with a 2048-byte attr causes a fs shutdown because we
7 # remove the shortform attr, convert the attr fork to long format, and then
8 # try to re-add the attr having not cleared ATTR_REPLACE.
10 # Commit 7b38460dc8e4 ("xfs: don't fail when converting shortform attr to long
11 # form during ATTR_REPLACE") fixed the xfs bug.
13 #-----------------------------------------------------------------------
14 # Copyright (c) 2018 Oracle. All Rights Reserved.
16 # This program is free software; you can redistribute it and/or
17 # modify it under the terms of the GNU General Public License as
18 # published by the Free Software Foundation.
20 # This program is distributed in the hope that it would be useful,
21 # but WITHOUT ANY WARRANTY; without even the implied warranty of
22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write the Free Software Foundation,
27 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #-----------------------------------------------------------------------
32 seqres=$RESULT_DIR/$seq
33 echo "QA output created by $seq"
35 status=1 # failure is the default!
36 trap "_cleanup; exit \$status" 0 1 2 3 15
44 # get standard environment, filters and checks
49 # remove previous $seqres.full before test
52 # real QA test starts here
55 _require_test_program "attr_replace_test"
60 _scratch_mkfs >>$seqres.full 2>&1
61 _scratch_mount >>$seqres.full 2>&1
63 filter_attr_output() {
64 _filter_scratch | sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
67 ./src/attr_replace_test $SCRATCH_MNT/hello
68 $ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output