#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2015 SUSE Linux Products GmbH. All Rights Reserved.
+#
# FS QA Test No. 002
#
# Test that after syncing the filesystem, adding many xattrs to a file, syncing
#
# This test is motivated by a bug found in btrfs.
#
-#-----------------------------------------------------------------------
-# Copyright (C) 2015 SUSE Linux Products GmbH. All Rights Reserved.
-# Author: Filipe Manana <fdmanana@suse.com>
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-#-----------------------------------------------------------------------
-#
-
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
# as ext3/4 and f2fs for example, fail with ENOSPC even if we attempt to add
# less than 1000 xattrs with very small values.
_supported_fs btrfs xfs
-_supported_os Linux
-_need_to_be_root
_require_scratch
_require_dm_target flakey
_require_attrs
-_require_metadata_journaling $SCRATCH_DEV
rm -f $seqres.full
_scratch_mkfs >> $seqres.full 2>&1
+_require_metadata_journaling $SCRATCH_DEV
_init_flakey
_mount_flakey
for ((i = 1; i <= $num_xattrs; i++)); do
name="user.attr_$(printf "%04d" $i)"
echo -n "$name="
- $GETFATTR_PROG --absolute-names -n $name --only-values $SCRATCH_MNT/foo
+ _getfattr --absolute-names -n $name --only-values $SCRATCH_MNT/foo
echo
done