_set_variable
}
-_error()
-{
- echo "Error: $*" | tee -a $here/$seq.full
- echo "(see $here/$seq.full for details)"
- status=1
- exit
-}
-
_wipe_fs()
{
_require_scratch
- _scratch_mkfs_xfs >>$here/$seq.full || _error "mkfs failed"
- _scratch_mount >>$here/$seq.full || _error "mount failed"
+ _scratch_mkfs_xfs >>$here/$seq.full || _fail "mkfs failed"
+ _scratch_mount >>$here/$seq.full || _fail "mount failed"
}
#
_stable_fs()
{
_saveddir=`pwd`; cd /
- umount $SCRATCH_MNT >>$here/$seq.full || _error "unmount failed"
- _scratch_mount >>$here/$seq.full || _error "mount failed"
+ umount $SCRATCH_MNT >>$here/$seq.full || _fail "unmount failed"
+ _scratch_mount >>$here/$seq.full || _fail "mount failed"
cd $_saveddir
}
#
-# Run src/fsstress to create a mixture of
+# Run fsstress to create a mixture of
# files,dirs,links,symlinks
#
# Pinched from test 013.
#
_create_dumpdir_stress()
{
- echo "Creating directory system to dump using src/fsstress."
+ echo "Creating directory system to dump using fsstress."
_wipe_fs
echo "-----------------------------------------------"
echo "fsstress : $_param"
echo "-----------------------------------------------"
- if ! $here/src/fsstress $_param -s 1 $FSSTRESS_AVOID -n $_count -d $dump_dir >$tmp.out 2>&1
+ if ! $here/ltp/fsstress $_param -s 1 $FSSTRESS_AVOID -n $_count -d $dump_dir >$tmp.out 2>&1
then
echo " fsstress (count=$_count) returned $? - see $here/$seq.full"
End-of-File
}
+#
+# extended file attribute flags
+#
+_mk_fillconfig_xattr()
+{
+ cat <<End-of-File >$tmp.config
+# pathname size user group perm name
+#
+xflag_realtime 10 $nobody $nobody 777 XFS_XFLAG_REALTIME
+xflag_prealloc 10 $nobody $nobody 777 XFS_XFLAG_PREALLOC
+xflag_immutable 10 $nobody $nobody 777 XFS_XFLAG_IMMUTABLE
+xflag_append 10 $nobody $nobody 777 XFS_XFLAG_APPEND
+xflag_sync 10 $nobody $nobody 777 XFS_XFLAG_SYNC
+xflag_noatime 10 $nobody $nobody 777 XFS_XFLAG_NOATIME
+xflag_nodump 10 $nobody $nobody 777 XFS_XFLAG_NODUMP
+xflag_hasattr 10 $nobody $nobody 777 XFS_XFLAG_HASATTR
+End-of-File
+}
+
#
# Create a bunch of directories/files of different sizes
# filled with data.
{
echo "Creating directory system to dump using src/fill."
- mkdir -p $dump_dir ||\
- _error "cannot mkdir \"$dump_dir\""
+ mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
cd $dump_dir
$verbose && echo -n "Setup "
if [ -n "$perms" ]; then
chmod $perms $file
fi
+ # extended attributes (EA)
if [ -n "$ea_name" -a -n "$ea_value" ]; then
if [ "X$namespace" = "Xroot" ]; then
attr -R -s $ea_name -V $ea_value $file
else
attr -s $ea_name -V $ea_value $file
fi
+ # extended file attribute flags - no value - NOT EAs
+ elif [ -n "$ea_name" -a -z "$ea_value" ]; then
+ # set the flag
+ # TODO XXX
+ # use xfs_io to send the ioctl
+ :
fi
$verbose && echo -n "."
done
_create_dumpdir_largefile()
{
_wipe_fs
- mkdir -p $dump_dir ||\
- _error "cannot mkdir \"$dump_dir\""
+ mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
_largesize=4294967297
_largefile=$dump_dir/largefile
echo "dd a largefile at offset $_largesize"
{
echo "Creating directory system of symlinks to dump."
- mkdir -p $dump_dir ||\
- _error "cannot mkdir \"$dump_dir\""
+ mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
cd $dump_dir
$verbose && echo -n "Setup "
_wipe_fs
echo "Creating directory system of hardlinks to incrementally dump."
- mkdir -p $dump_dir ||\
- _error "cannot mkdir \"$dump_dir\""
+ mkdir -p $dump_dir || _fail "cannot mkdir \"$dump_dir\""
cd $dump_dir
_create_hardset $_numsets
#
# Filter for ls
# Filter out dates on symlinks and char devices
+# Filter out size on directories because this can differ
+# when transitioning to long inode numbers (ie. 64 bits).
#
_ls_filter()
{
$AWK_PROG '
/^l/ { date = $8; sub(date,"DATE"); print}
/^c/ { date = $9; sub(date,"DATE"); print}
+ /^d/ { size = $5; sub(size,"SIZE"); print}
{print}' \
- | sed -e 's/total [0-9][0-9]*/total TOTAL/'
+ | sed -e 's/total [0-9][0-9]*/total TOTAL/' -e 's/[ \t][ \t]*/ /g'
}
case $1
in
-f)
- [ -z "$2" ] && _error "missing argument for -f"
+ [ -z "$2" ] && _fail "missing argument for -f"
dumptape=$2
shift
;;
-L)
- [ -z "$2" ] && _error "missing argument for -L"
+ [ -z "$2" ] && _fail "missing argument for -L"
session_label=$2
shift
;;
do_quota_check=false
;;
-l)
- [ -z "$2" ] && _error "missing argument for -l"
+ [ -z "$2" ] && _fail "missing argument for -l"
dump_args="$dump_args -l$2"
shift
;;
*)
- _error "invalid argument to common.dump function: $1"
+ _fail "invalid argument to common.dump function: $1"
;;
esac
shift
_prepare_restore_dir()
{
rm -rf $restore_dir
- mkdir $restore_dir ||\
- _error "failed to mkdir $restore_dir"
+ mkdir $restore_dir || _fail "failed to mkdir $restore_dir"
}
# sort |\
# and this is now the Linux way...
echo "User names"
- getfattr --absolute-names -Rh $_path |\
+ getfattr --absolute-names -Rh -m user $_path |\
perl -wn -e '
if (m/^# file: (\S+)/) { $file = $1 }
elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
attr -g $ea_name $file
done
+ if [ "$USE_ATTR_SECURE" = yes ]; then
+ echo "Security names"
+ getfattr --absolute-names -Rh -m security $_path |\
+ perl -wn -e '
+ if (m/^# file: (\S+)/) { $file = $1 }
+ elsif (m/^security\.(\w+)/) { print $file, " ",$1,"\n" }' |\
+ sort |\
+ while read file ea_name; do
+ attr -g $ea_name $file
+ done
+ fi
+
echo "Root names"
getfattr --absolute-names -Rh -m trusted $_path |\
perl -wn -e '