2018-05-01 08:39:26 -07:00
|
|
|
#! /bin/bash
|
2018-06-09 11:35:42 +10:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
# Copyright (c) 2018 Oracle. All Rights Reserved.
|
|
|
|
|
#
|
2018-05-01 08:39:26 -07:00
|
|
|
# FS QA Test No. 486
|
|
|
|
|
#
|
|
|
|
|
# Ensure that we can XATTR_REPLACE a tiny attr into a large attr.
|
|
|
|
|
# Kanda Motohiro <kanda.motohiro@gmail.com> reports that XATTR_REPLACE'ing
|
|
|
|
|
# a single-byte attr with a 2048-byte attr causes a fs shutdown because we
|
|
|
|
|
# remove the shortform attr, convert the attr fork to long format, and then
|
|
|
|
|
# try to re-add the attr having not cleared ATTR_REPLACE.
|
|
|
|
|
#
|
|
|
|
|
# Commit 7b38460dc8e4 ("xfs: don't fail when converting shortform attr to long
|
|
|
|
|
# form during ATTR_REPLACE") fixed the xfs bug.
|
|
|
|
|
#
|
|
|
|
|
seq=`basename $0`
|
|
|
|
|
seqres=$RESULT_DIR/$seq
|
|
|
|
|
echo "QA output created by $seq"
|
|
|
|
|
|
2019-10-21 21:35:46 +08:00
|
|
|
here=`pwd`
|
2018-05-01 08:39:26 -07:00
|
|
|
status=1 # failure is the default!
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
cd /
|
|
|
|
|
rm -f $testfile
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# get standard environment, filters and checks
|
|
|
|
|
. ./common/rc
|
|
|
|
|
. ./common/filter
|
|
|
|
|
. ./common/attr
|
|
|
|
|
|
|
|
|
|
# remove previous $seqres.full before test
|
|
|
|
|
rm -f $seqres.full
|
|
|
|
|
|
|
|
|
|
# real QA test starts here
|
|
|
|
|
_supported_fs generic
|
|
|
|
|
_supported_os Linux
|
|
|
|
|
_require_test_program "attr_replace_test"
|
|
|
|
|
_require_attrs
|
|
|
|
|
_require_scratch
|
|
|
|
|
|
|
|
|
|
rm -f $seqres.full
|
|
|
|
|
_scratch_mkfs >>$seqres.full 2>&1
|
|
|
|
|
_scratch_mount >>$seqres.full 2>&1
|
|
|
|
|
|
|
|
|
|
filter_attr_output() {
|
2019-06-27 17:00:59 +08:00
|
|
|
_filter_scratch | grep world | \
|
|
|
|
|
sed -e 's/has a [0-9]* byte value/has a NNNN byte value/g'
|
2018-05-01 08:39:26 -07:00
|
|
|
}
|
|
|
|
|
|
2019-10-21 21:35:46 +08:00
|
|
|
$here/src/attr_replace_test $SCRATCH_MNT/hello
|
2019-06-27 17:00:59 +08:00
|
|
|
$ATTR_PROG -l $SCRATCH_MNT/hello >>$seqres.full 2>&1
|
2018-05-01 08:39:26 -07:00
|
|
|
$ATTR_PROG -l $SCRATCH_MNT/hello | filter_attr_output
|
|
|
|
|
|
|
|
|
|
status=0
|
|
|
|
|
exit
|