summaryrefslogtreecommitdiff
path: root/tests/generic/611
blob: 3dfeb02b5f4b8bd7575797075dee67482603c70a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020 Red Hat, Inc. All Rights Reserved.
#
# FS QA Test 611
#
# Verify that metadata won't get corrupted when extended attribute
# name of size one is set.
#
# This test verifies the problem fixed in kernel with commit
# f4020438fab0 ("xfs: fix boundary test in xfs_attr_shortform_verify")

. ./common/preamble
_begin_fstest auto quick attr

# Import common functions.
. ./common/filter
. ./common/attr

# real QA test starts here

_supported_fs generic
_require_scratch
_require_attrs

_scratch_mkfs > $seqres.full 2>&1
_scratch_mount

localfile="${SCRATCH_MNT}/testfile"

touch "${localfile}"
"${SETFATTR_PROG}" -n user.a "${localfile}"

# Make sure that changes are written to disk
_scratch_cycle_mount

# If the target bug isn't fixed, getfattr fails
_getfattr --absolute-names -n user.a $localfile | grep 'user.a'

status=0
exit