2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2020 Red Hat, Inc. All Rights Reserved.
7 # Verify that metadata won't get corrupted when extended attribute
8 # name of size one is set.
10 # This test verifies the problem fixed in kernel with commit
11 # f4020438fab0 ("xfs: fix boundary test in xfs_attr_shortform_verify")
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
28 # get standard environment, filters and checks
33 # remove previous $seqres.full before test
36 # real QA test starts here
42 _scratch_mkfs > $seqres.full 2>&1
45 localfile="${SCRATCH_MNT}/testfile"
48 "${SETFATTR_PROG}" -n user.a "${localfile}"
50 # Make sure that changes are written to disk
53 # If the target bug isn't fixed, getfattr fails
54 _getfattr --absolute-names -n user.a $localfile | grep 'user.a'