xfstests: move remaining tests out of top level directory
authorDave Chinner <dchinner@redhat.com>
Fri, 15 Mar 2013 12:27:58 +0000 (12:27 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 27 Mar 2013 01:45:43 +0000 (20:45 -0500)
These are tests that are shared between multiple filesystems (moved
to shared), and udf/btrfs/ext4 specific tests, moved to appropriate
directories.

I created the "shared" directory to indicate tests that are not
truly generic, but also not filesystem specific. They might rely on
a feature that is only implmented in a few filesystems and so can't
be truly generic.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
109 files changed:
032 [deleted file]
032.out [deleted file]
040 [deleted file]
040.good [deleted file]
040.out [deleted file]
051 [deleted file]
051.out [deleted file]
098 [deleted file]
098.out [deleted file]
101 [deleted file]
101.out [deleted file]
102 [deleted file]
102.out [deleted file]
177 [deleted file]
177.out [deleted file]
218 [deleted file]
218.out [deleted file]
243 [deleted file]
243.out [deleted file]
252 [deleted file]
252.out [deleted file]
254 [deleted file]
254.out [deleted file]
264 [deleted file]
264.out [deleted file]
265 [deleted file]
265.out [deleted file]
271 [deleted file]
271.out [deleted file]
272 [deleted file]
272.out [deleted file]
276 [deleted file]
276.out [deleted file]
284 [deleted file]
284.out [deleted file]
289 [deleted file]
289.out [deleted file]
298 [deleted file]
298.out [deleted file]
301 [deleted file]
301.out [deleted file]
302 [deleted file]
302.out [deleted file]
303 [deleted file]
303.out [deleted file]
304 [deleted file]
304.out [deleted file]
305 [deleted file]
305.out [deleted file]
307 [deleted file]
307.out [deleted file]
check
group
tests/btrfs/254 [new file with mode: 0755]
tests/btrfs/254.out [new file with mode: 0644]
tests/btrfs/264 [new file with mode: 0755]
tests/btrfs/264.out [new file with mode: 0644]
tests/btrfs/265 [new file with mode: 0755]
tests/btrfs/265.out [new file with mode: 0644]
tests/btrfs/276 [new file with mode: 0755]
tests/btrfs/276.out [new file with mode: 0644]
tests/btrfs/284 [new file with mode: 0644]
tests/btrfs/284.out [new file with mode: 0644]
tests/btrfs/307 [new file with mode: 0644]
tests/btrfs/307.out [new file with mode: 0644]
tests/btrfs/group [new file with mode: 0644]
tests/ext4/271 [new file with mode: 0755]
tests/ext4/271.out [new file with mode: 0644]
tests/ext4/301 [new file with mode: 0644]
tests/ext4/301.out [new file with mode: 0644]
tests/ext4/302 [new file with mode: 0644]
tests/ext4/302.out [new file with mode: 0644]
tests/ext4/303 [new file with mode: 0644]
tests/ext4/303.out [new file with mode: 0644]
tests/ext4/304 [new file with mode: 0644]
tests/ext4/304.out [new file with mode: 0644]
tests/ext4/group [new file with mode: 0644]
tests/shared/032 [new file with mode: 0755]
tests/shared/032.out [new file with mode: 0644]
tests/shared/051 [new file with mode: 0755]
tests/shared/051.out [new file with mode: 0644]
tests/shared/218 [new file with mode: 0755]
tests/shared/218.out [new file with mode: 0644]
tests/shared/243 [new file with mode: 0755]
tests/shared/243.out [new file with mode: 0644]
tests/shared/272 [new file with mode: 0755]
tests/shared/272.out [new file with mode: 0644]
tests/shared/289 [new file with mode: 0755]
tests/shared/289.out [new file with mode: 0644]
tests/shared/298 [new file with mode: 0644]
tests/shared/298.out [new file with mode: 0644]
tests/shared/305 [new file with mode: 0644]
tests/shared/305.out [new file with mode: 0644]
tests/shared/group [new file with mode: 0644]
tests/udf/098 [new file with mode: 0755]
tests/udf/098.out [new file with mode: 0644]
tests/udf/101 [new file with mode: 0755]
tests/udf/101.out [new file with mode: 0644]
tests/udf/102 [new file with mode: 0755]
tests/udf/102.out [new file with mode: 0644]
tests/udf/group [new file with mode: 0644]
tests/xfs/040 [new file with mode: 0755]
tests/xfs/040.good [new file with mode: 0644]
tests/xfs/040.out [new file with mode: 0644]
tests/xfs/177 [new file with mode: 0755]
tests/xfs/177.out [new file with mode: 0644]
tests/xfs/252 [new file with mode: 0755]
tests/xfs/252.out [new file with mode: 0644]
tests/xfs/group

diff --git a/032 b/032
deleted file mode 100755 (executable)
index 768b7f0..0000000
--- a/032
+++ /dev/null
@@ -1,95 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 032
-#
-# cross check mkfs detection of foreign filesystems
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-rm -f $seq.full
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-_supported_fs xfs btrfs
-_supported_os Linux
-
-_require_scratch
-_require_no_large_scratch_dev
-
-# mkfs.btrfs did not have overwrite detection at first
-if [ "$FSTYP" == "btrfs" ]; then
-       grep -q 'force overwrite' `echo $MKFS_BTRFS_PROG | awk '{print $1}'` || \
-               _notrun "Installed mkfs.btrfs does not support -f option"
-fi
-
-echo "Silence is golden."
-for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
-do
-       preop=""        # for special input needs
-       preargs=""      # for any special pre-device options
-       postargs=""     # for any special post-device options
-
-       # minix, msdos and vfat mkfs fails for large devices, restrict to 2000 blocks
-       [ $fs = minix ] && postargs=2000
-       [ $fs = msdos ] && postargs=2000
-       [ $fs = vfat ] && postargs=2000
-       # these folks prompt before writing
-       [ $fs = jfs ] && preop="echo Y |"
-       [ $fs = gfs ] && preop="echo y |" && preargs="-p lock_nolock -j 1"
-       [ $fs = gfs2 ] && preop="echo y |" && preargs="-p lock_nolock -j 1"
-       [ $fs = reiserfs ] && preop="echo y |" && preargs="-f"
-       # cramfs mkfs requires a directory argument
-       [ $fs = cramfs ] && preargs=/proc/fs
-       [ $fs = ext2 ] && preargs="-F"
-       [ $fs = ext3 ] && preargs="-F"
-       [ $fs = ext4 ] && preargs="-F"
-       [ $fs = ext4dev ] && preargs="-F"
-
-       # overwite the first few Kb - should blow away superblocks
-       src/devzero -n 20 $SCRATCH_DEV >/dev/null
-
-       # create a filesystem of this type
-       echo "=== Creating $fs filesystem..." >>$seq.full
-       echo "    ( $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs )" >>$seq.full
-       eval $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs >>$seq.full 2>&1
-
-       if [ $? -eq 0 ] ; then
-               # next, ensure we don't overwrite it
-               echo "=== Attempting $FSTYP overwrite of $fs..." >>$seq.full
-               ${MKFS_PROG}.$FSTYP $SCRATCH_DEV >>$seq.full 2>&1
-
-               [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
-       else
-               echo "mkfs of type ${fs} failed" >>$seq.full
-       fi
-done
-
-# success, all done
-status=0
-exit
diff --git a/032.out b/032.out
deleted file mode 100644 (file)
index 9265732..0000000
--- a/032.out
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 032
-Silence is golden.
diff --git a/040 b/040
deleted file mode 100755 (executable)
index 0021c22..0000000
--- a/040
+++ /dev/null
@@ -1,60 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 040
-#
-# srcdiff test
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-[ -z "$KWORKAREA" ] && \
-       _notrun "Can't run srcdiff without KWORKAREA set"
-[ -d "$KWORKAREA/fs/xfs" ] || \
-       _notrun "Can't find XFS source under \"$KWORKAREA\""
-
-[ -z "$WORKAREA" ] && \
-       _notrun "Can't run srcdiff without WORKAREA set"
-[ -f "$WORKAREA/xfstests/tools/srcdiff" ] || \
-       _notrun "Can't find srcdiff tool under \"$WORKAREA\""
-[ -d "$WORKAREA/xfsprogs/include" ] || \
-       _notrun "Can't find XFS command headers under \"$WORKAREA\""
-
-# real QA test starts here
-cd "$WORKAREA/xfstests"
-echo Silence is golden.
-perl tools/srcdiff -q >$seq.full
-if ! diff $seq.full $seq.good >/dev/null; then
-    echo "FAILED: srcdiff output $seq.full differs to $seq.good"
-    exit 1
-fi
-
-# success, all done
-status=0
-exit
diff --git a/040.good b/040.good
deleted file mode 100644 (file)
index 6df7788..0000000
--- a/040.good
+++ /dev/null
@@ -1,16 +0,0 @@
-
-=== Checking attr package ===
-
-=== Checking acl package ===
-
-=== Checking dmapi package ===
-
-=== Checking xfsdump package ===
-
-=== Checking xfsprogs package ===
-
-=== Checking headers ===
-
-=== Checking libxfs code ===
-
-=== Checking libxlog code ===
diff --git a/040.out b/040.out
deleted file mode 100644 (file)
index 45b1dea..0000000
--- a/040.out
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 040
-Silence is golden.
diff --git a/051 b/051
deleted file mode 100755 (executable)
index 07d5a9b..0000000
--- a/051
+++ /dev/null
@@ -1,366 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 051
-#
-# Test out ACLs.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-
-here=`pwd`
-tmp=/tmp/$$
-runas=$here/src/runas
-status=1       # FAILure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.attr
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-    [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
-    _cleanup_testdir
-}
-
-# -----
-# minimal access ACL has ACEs: USER_OBJ, GROUP_OBJ, OTHER_OBJ
-# This is set with chacl(1) and can be changed by chmod(1).
-#
-# Test that this is being set for ACL and for std unix permissions
-# Test that we can get back the same ACL.
-# Test std permissions for rwx.
-# -----
-#
-# Test out default ACLs and that the ACL is being PASSed
-# onto the children of the dir.
-#
-# -----
-# Test out access check for extended ACLs.
-# -> 3 extra ACEs: MASK, GROUP, USER
-# -> the GROUP compares with egid of process _and_ the supplementary
-#    groups (as found in /etc/group)
-#
-# Test that mask works for USER, GROUP, GROUP_OBJ
-# Test that the ACE type priority is working
-#   -> this would be done by simultaneously matching on ACEs
-#   -> interesting if it allows user to specify ACEs in any order
-#
-
-# real QA test starts here
-_supported_fs xfs udf
-_supported_os Linux
-
-[ -x $runas ] || _notrun "$runas executable not found"
-
-rm -f $seq.full
-
-_setup_testdir
-
-_need_to_be_root
-_acl_setup_ids
-_require_acls
-
-# get dir
-cd $testdir
-rm -rf $seq.dir1
-mkdir $seq.dir1
-cd $seq.dir1
-
-echo "QA output created by $seq"
-echo ""
-echo "=== Test minimal ACE ==="
-
-echo "Setup file"
-# Note: as this is a shell script,
-#       will need read and execute permission set
-#       in order to execute it.
-touch file1
-cat <<EOF >file1
-#!/bin/bash
-echo "Test was executed"
-EOF
-chmod u=rwx file1
-chmod g=rw- file1
-chmod o=r-- file1
-chown $acl1.$acl2 file1
-_acl_ls file1
-
-echo ""
-echo "--- Test get and set of ACL ---"
-echo "Note: Old interface gave an empty ACL - now output an ACL"
-chacl -l file1 | _acl_filter_id
-echo "Try using single colon separator"
-echo "Note: Old interface FAILed because of single colon - new one allows it" 
-chacl u::r--,g::rwx,o:rw- file1 2>&1
-echo "Expect to PASS" 
-chacl u::r--,g::rwx,o::rw- file1 2>&1
-chacl -l file1 | _acl_filter_id
-
-echo ""
-echo "--- Test sync of ACL with std permissions ---"
-_acl_ls file1
-chmod u+w file1
-_acl_ls file1
-chacl -l file1 | _acl_filter_id
-
-echo ""
-echo "--- Test owner permissions ---"
-chacl u::r-x,g::---,o::--- file1 2>&1
-chacl -l file1 | _acl_filter_id
-# change to owner
-echo "Expect to PASS" 
-$runas -u $acl1 -g $acl1 ./file1 2>&1
-echo "Expect to FAIL" 
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-
-echo ""
-echo "--- Test group permissions ---"
-chacl u::---,g::r-x,o::--- file1 2>&1
-chacl -l file1 | _acl_filter_id
-echo "Expect to FAIL - acl1 is owner" 
-$runas -u $acl1 -g $acl1 ./file1 2>&1
-echo "Expect to PASS - acl2 matches group" 
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-echo "Expect to PASS - acl2 matches sup group" 
-$runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1
-echo "Expect to FAIL - acl3 is not in group" 
-$runas -u $acl3 -g $acl3 ./file1 2>&1
-
-echo ""
-echo "--- Test other permissions ---"
-chacl u::---,g::---,o::r-x file1 2>&1
-chacl -l file1 | _acl_filter_id
-echo "Expect to FAIL - acl1 is owner" 
-$runas -u $acl1 -g $acl1 ./file1 2>&1
-echo "Expect to FAIL - acl2 is in group" 
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-echo "Expect to FAIL - acl2 is in sup. group" 
-$runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1
-echo "Expect to PASS - acl3 is not owner or in group" 
-$runas -u $acl3 -g $acl3 ./file1 2>&1
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Test Extended ACLs ==="
-
-echo ""
-echo "--- Test adding a USER ACE ---"
-echo "Expect to FAIL as no MASK provided"
-chacl u::---,g::---,o::---,u:$acl2:r-x file1 2>&1 | _acl_filter_id
-echo "Ensure that ACL has not been changed"
-chacl -l file1 | _acl_filter_id
-echo "Expect to PASS - USER ACE matches user"
-chacl u::---,g::---,o::---,u:$acl2:r-x,m::rwx file1 2>&1
-chacl -l file1 | _acl_filter_id
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-echo "Expect to FAIL - USER ACE does not match user"
-$runas -u $acl3 -g $acl3 ./file1 2>&1
-
-echo ""
-echo "--- Test adding a GROUP ACE ---"
-echo "Expect to FAIL as no MASK provided"
-chacl u::---,g::---,o::---,g:$acl2:r-x file1 2>&1 | _acl_filter_id
-echo "Ensure that ACL has not been changed"
-chacl -l file1 | _acl_filter_id
-chacl u::---,g::---,o::---,g:$acl2:r-x,m::rwx file1 2>&1
-chacl -l file1 | _acl_filter_id
-echo "Expect to PASS - GROUP ACE matches group"
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-echo "Expect to PASS - GROUP ACE matches sup group"
-$runas -u $acl2 -g $acl1 -s $acl2 ./file1 2>&1
-echo "Expect to FAIL - GROUP ACE does not match group"
-$runas -u $acl3 -g $acl3 ./file1 2>&1
-
-#-------------------------------------------------------
-
-echo ""
-echo "--- Test MASK ---"
-
-# group
-chacl u::---,g::---,o::---,g:$acl2:r-x,m::-w- file1 2>&1
-chacl -l file1 | _acl_filter_id
-echo "Expect to FAIL as MASK prohibits execution"
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-
-# user
-chacl u::---,g::---,o::---,u:$acl2:r-x,m::-w- file1 2>&1
-echo "Expect to FAIL as MASK prohibits execution"
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-
-# user
-chacl u::---,g::---,o::---,u:$acl2:r-x,m::r-x file1 2>&1
-echo "Expect to PASS as MASK allows execution"
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-
-#-------------------------------------------------------
-
-echo ""
-echo "--- Test ACE priority ---"
-
-chacl o::rwx,g::rwx,u:$acl1:rwx,u::---,m::rwx file1 2>&1
-echo "Expect to FAIL as should match on owner"
-$runas -u $acl1 -g $acl2 ./file1 2>&1
-
-chacl o::---,g::---,u:$acl2:rwx,u::---,m::rwx file1 2>&1
-echo "Expect to PASS as should match on user"
-$runas -u $acl2 -g $acl2 ./file1 2>&1
-
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Test can read ACLs without access permissions ==="
-# This was a bug in kernel code where syscred wasn't being used
-# to override the capabilities
-chacl o::---,g::---,u::--- file1 2>&1
-chacl -l file1 | _acl_filter_id
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Test Default ACLs ==="
-# make test clearer by testing with and without umask
-umask 0
-
-mkdir acldir
-chacl -b "u::rwx,g::rwx,o::rwx" "u::r-x,g::r--,o::---" acldir 2>&1
-chacl -l acldir | _acl_filter_id
-cd acldir
-
-touch file2
-_acl_ls file2
-chacl -l file2 | _acl_filter_id
-
-#ensure that umask is not having an effect 
-#so set it and see
-umask 722
-touch file3
-_acl_ls file3
-chacl -l file3 | _acl_filter_id
-
-cd ..
-umask 022
-
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Removing ACLs ==="
-chacl -l file1 | _acl_filter_id
-chacl -l acldir | _acl_filter_id
-chacl -l acldir/file2 | _acl_filter_id
-echo "Remove ACLs..."
-chacl -R file1
-chacl -B acldir
-chacl -R acldir/file2
-echo "Note: Old interface would mean empty ACLs - now we show mode ACLs" 
-chacl -l file1 | _acl_filter_id
-chacl -l acldir | _acl_filter_id
-chacl -l acldir/file2 | _acl_filter_id
-
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Recursive change ACL ==="
-rm -fr root
-mkdir root
-pushd root >/dev/null
-# create an arbitrary little tree
-for i in 1 2 3 4 5 6 7 8 9 0
-do
-       mkdir -p a/$i
-       mkdir -p b/c$i/$i
-       touch a/$i/mumble
-done
-popd >/dev/null
-chown -R 12345.54321 root
-echo "Change #1..."
-$runas -u 12345 -g 54321 -- `which chacl` -r u::rwx,g::-w-,o::--x root
-find root -print | xargs chacl -l
-echo "Change #2..."
-$runas -u 12345 -g 54321 -- `which chacl` -r u::---,g::---,o::--- root
-find root -print | xargs chacl -l
-
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Test out error messages for ACL text parsing  ==="
-echo "Note: Old interface gave more informative error msgs"
-
-touch file1
-set -x
-chacl u file1
-chacl u: file1
-chacl u:rumpledumpleunknownuser file1
-chacl u:rumpledumpleunknownuser: file1
-chacl g:rumpledumpleunknowngrp file1
-chacl g:rumpledumpleunknowngrp: file1
-chacl o:user1:rwx file1
-chacl m:user1:rwx file1
-chacl a::rwx file1
-set +x
-
-#-------------------------------------------------------
-
-echo ""
-echo "=== Test out large ACLs  ==="
-touch largeaclfile
-XFS_ACL_MAX_ENTRIES=25
-num_aces_pre=`expr $XFS_ACL_MAX_ENTRIES - 1`
-num_aces_post=`expr $XFS_ACL_MAX_ENTRIES + 1`
-
-acl1=`_create_n_aces $num_aces_pre`
-acl2=`_create_n_aces $XFS_ACL_MAX_ENTRIES`
-acl3=`_create_n_aces $num_aces_post`
-acl4=`_create_n_aces 16` # Andreas G. libacl size for initial get
-acl5=`_create_n_aces 17` # 1 over A.G. libacl initial size
-
-echo "1 below xfs acl max"
-chacl $acl1 largeaclfile
-getfacl --numeric largeaclfile | _filter_aces
-
-echo "xfs acl max"
-chacl $acl2 largeaclfile
-getfacl --numeric largeaclfile | _filter_aces
-
-echo "1 above xfs acl max"
-chacl $acl3 largeaclfile
-getfacl --numeric largeaclfile | _filter_aces
-
-echo "use 16 aces"
-chacl $acl4 largeaclfile
-getfacl --numeric largeaclfile | _filter_aces
-
-echo "use 17 aces"
-chacl $acl5 largeaclfile
-getfacl --numeric largeaclfile | _filter_aces
-
-#-------------------------------------------------------
-
-# success, all done
-status=0
-exit
diff --git a/051.out b/051.out
deleted file mode 100644 (file)
index a871082..0000000
--- a/051.out
+++ /dev/null
@@ -1,355 +0,0 @@
-QA output created by 051
-
-=== Test minimal ACE ===
-Setup file
--rwxrw-r-- id1 id2 file1
-
---- Test get and set of ACL ---
-Note: Old interface gave an empty ACL - now output an ACL
-file1 [u::rwx,g::rw-,o::r--]
-Try using single colon separator
-Note: Old interface FAILed because of single colon - new one allows it
-Expect to PASS
-file1 [u::r--,g::rwx,o::rw-]
-
---- Test sync of ACL with std permissions ---
--r--rwxrw- id1 id2 file1
--rw-rwxrw- id1 id2 file1
-file1 [u::rw-,g::rwx,o::rw-]
-
---- Test owner permissions ---
-file1 [u::r-x,g::---,o::---]
-Expect to PASS
-Test was executed
-Expect to FAIL
-./file1: Permission denied
-
---- Test group permissions ---
-file1 [u::---,g::r-x,o::---]
-Expect to FAIL - acl1 is owner
-./file1: Permission denied
-Expect to PASS - acl2 matches group
-Test was executed
-Expect to PASS - acl2 matches sup group
-Test was executed
-Expect to FAIL - acl3 is not in group
-./file1: Permission denied
-
---- Test other permissions ---
-file1 [u::---,g::---,o::r-x]
-Expect to FAIL - acl1 is owner
-./file1: Permission denied
-Expect to FAIL - acl2 is in group
-./file1: Permission denied
-Expect to FAIL - acl2 is in sup. group
-./file1: Permission denied
-Expect to PASS - acl3 is not owner or in group
-Test was executed
-
-=== Test Extended ACLs ===
-
---- Test adding a USER ACE ---
-Expect to FAIL as no MASK provided
-chacl: access ACL 'u::---,g::---,o::---,u:id2:r-x': Missing or wrong entry at entry 3
-Ensure that ACL has not been changed
-file1 [u::---,g::---,o::r-x]
-Expect to PASS - USER ACE matches user
-file1 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
-Test was executed
-Expect to FAIL - USER ACE does not match user
-./file1: Permission denied
-
---- Test adding a GROUP ACE ---
-Expect to FAIL as no MASK provided
-chacl: access ACL 'u::---,g::---,o::---,g:id2:r-x': Missing or wrong entry at entry 3
-Ensure that ACL has not been changed
-file1 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
-file1 [u::---,g::---,g:id2:r-x,m::rwx,o::---]
-Expect to PASS - GROUP ACE matches group
-Test was executed
-Expect to PASS - GROUP ACE matches sup group
-Test was executed
-Expect to FAIL - GROUP ACE does not match group
-./file1: Permission denied
-
---- Test MASK ---
-file1 [u::---,g::---,g:id2:r-x,m::-w-,o::---]
-Expect to FAIL as MASK prohibits execution
-./file1: Permission denied
-Expect to FAIL as MASK prohibits execution
-./file1: Permission denied
-Expect to PASS as MASK allows execution
-Test was executed
-
---- Test ACE priority ---
-Expect to FAIL as should match on owner
-./file1: Permission denied
-Expect to PASS as should match on user
-Test was executed
-
-=== Test can read ACLs without access permissions ===
-file1 [u::---,g::---,o::---]
-
-=== Test Default ACLs ===
-acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---]
--r--r----- 0 0 file2
-file2 [u::r--,g::r--,o::---]
--r--r----- 0 0 file3
-file3 [u::r--,g::r--,o::---]
-
-=== Removing ACLs ===
-file1 [u::---,g::---,o::---]
-acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---]
-acldir/file2 [u::r--,g::r--,o::---]
-Remove ACLs...
-Note: Old interface would mean empty ACLs - now we show mode ACLs
-file1 [u::---,g::---,o::---]
-acldir [u::rwx,g::rwx,o::rwx]
-acldir/file2 [u::r--,g::r--,o::---]
-
-=== Recursive change ACL ===
-Change #1...
-root [u::rwx,g::-w-,o::--x]
-root/a [u::rwx,g::-w-,o::--x]
-root/a/1 [u::rwx,g::-w-,o::--x]
-root/a/1/mumble [u::rwx,g::-w-,o::--x]
-root/a/2 [u::rwx,g::-w-,o::--x]
-root/a/2/mumble [u::rwx,g::-w-,o::--x]
-root/a/3 [u::rwx,g::-w-,o::--x]
-root/a/3/mumble [u::rwx,g::-w-,o::--x]
-root/a/4 [u::rwx,g::-w-,o::--x]
-root/a/4/mumble [u::rwx,g::-w-,o::--x]
-root/a/5 [u::rwx,g::-w-,o::--x]
-root/a/5/mumble [u::rwx,g::-w-,o::--x]
-root/a/6 [u::rwx,g::-w-,o::--x]
-root/a/6/mumble [u::rwx,g::-w-,o::--x]
-root/a/7 [u::rwx,g::-w-,o::--x]
-root/a/7/mumble [u::rwx,g::-w-,o::--x]
-root/a/8 [u::rwx,g::-w-,o::--x]
-root/a/8/mumble [u::rwx,g::-w-,o::--x]
-root/a/9 [u::rwx,g::-w-,o::--x]
-root/a/9/mumble [u::rwx,g::-w-,o::--x]
-root/a/0 [u::rwx,g::-w-,o::--x]
-root/a/0/mumble [u::rwx,g::-w-,o::--x]
-root/b [u::rwx,g::-w-,o::--x]
-root/b/c1 [u::rwx,g::-w-,o::--x]
-root/b/c1/1 [u::rwx,g::-w-,o::--x]
-root/b/c2 [u::rwx,g::-w-,o::--x]
-root/b/c2/2 [u::rwx,g::-w-,o::--x]
-root/b/c3 [u::rwx,g::-w-,o::--x]
-root/b/c3/3 [u::rwx,g::-w-,o::--x]
-root/b/c4 [u::rwx,g::-w-,o::--x]
-root/b/c4/4 [u::rwx,g::-w-,o::--x]
-root/b/c5 [u::rwx,g::-w-,o::--x]
-root/b/c5/5 [u::rwx,g::-w-,o::--x]
-root/b/c6 [u::rwx,g::-w-,o::--x]
-root/b/c6/6 [u::rwx,g::-w-,o::--x]
-root/b/c7 [u::rwx,g::-w-,o::--x]
-root/b/c7/7 [u::rwx,g::-w-,o::--x]
-root/b/c8 [u::rwx,g::-w-,o::--x]
-root/b/c8/8 [u::rwx,g::-w-,o::--x]
-root/b/c9 [u::rwx,g::-w-,o::--x]
-root/b/c9/9 [u::rwx,g::-w-,o::--x]
-root/b/c0 [u::rwx,g::-w-,o::--x]
-root/b/c0/0 [u::rwx,g::-w-,o::--x]
-Change #2...
-root [u::---,g::---,o::---]
-root/a [u::---,g::---,o::---]
-root/a/1 [u::---,g::---,o::---]
-root/a/1/mumble [u::---,g::---,o::---]
-root/a/2 [u::---,g::---,o::---]
-root/a/2/mumble [u::---,g::---,o::---]
-root/a/3 [u::---,g::---,o::---]
-root/a/3/mumble [u::---,g::---,o::---]
-root/a/4 [u::---,g::---,o::---]
-root/a/4/mumble [u::---,g::---,o::---]
-root/a/5 [u::---,g::---,o::---]
-root/a/5/mumble [u::---,g::---,o::---]
-root/a/6 [u::---,g::---,o::---]
-root/a/6/mumble [u::---,g::---,o::---]
-root/a/7 [u::---,g::---,o::---]
-root/a/7/mumble [u::---,g::---,o::---]
-root/a/8 [u::---,g::---,o::---]
-root/a/8/mumble [u::---,g::---,o::---]
-root/a/9 [u::---,g::---,o::---]
-root/a/9/mumble [u::---,g::---,o::---]
-root/a/0 [u::---,g::---,o::---]
-root/a/0/mumble [u::---,g::---,o::---]
-root/b [u::---,g::---,o::---]
-root/b/c1 [u::---,g::---,o::---]
-root/b/c1/1 [u::---,g::---,o::---]
-root/b/c2 [u::---,g::---,o::---]
-root/b/c2/2 [u::---,g::---,o::---]
-root/b/c3 [u::---,g::---,o::---]
-root/b/c3/3 [u::---,g::---,o::---]
-root/b/c4 [u::---,g::---,o::---]
-root/b/c4/4 [u::---,g::---,o::---]
-root/b/c5 [u::---,g::---,o::---]
-root/b/c5/5 [u::---,g::---,o::---]
-root/b/c6 [u::---,g::---,o::---]
-root/b/c6/6 [u::---,g::---,o::---]
-root/b/c7 [u::---,g::---,o::---]
-root/b/c7/7 [u::---,g::---,o::---]
-root/b/c8 [u::---,g::---,o::---]
-root/b/c8/8 [u::---,g::---,o::---]
-root/b/c9 [u::---,g::---,o::---]
-root/b/c9/9 [u::---,g::---,o::---]
-root/b/c0 [u::---,g::---,o::---]
-root/b/c0/0 [u::---,g::---,o::---]
-
-=== Test out error messages for ACL text parsing  ===
-Note: Old interface gave more informative error msgs
-+ chacl u file1
-chacl: u - Invalid argument
-+ chacl u: file1
-chacl: u: - Invalid argument
-+ chacl u:rumpledumpleunknownuser file1
-chacl: u:rumpledumpleunknownuser - Invalid argument
-+ chacl u:rumpledumpleunknownuser: file1
-chacl: u:rumpledumpleunknownuser: - Invalid argument
-+ chacl g:rumpledumpleunknowngrp file1
-chacl: g:rumpledumpleunknowngrp - Invalid argument
-+ chacl g:rumpledumpleunknowngrp: file1
-chacl: g:rumpledumpleunknowngrp: - Invalid argument
-+ chacl o:user1:rwx file1
-chacl: o:user1:rwx - Invalid argument
-+ chacl m:user1:rwx file1
-chacl: m:user1:rwx - Invalid argument
-+ chacl a::rwx file1
-chacl: a::rwx - Invalid argument
-+ set +x
-
-=== Test out large ACLs  ===
-1 below xfs acl max
-# file: largeaclfile
-# owner: 0
-# group: 0
-user::rwx
-user:1:rwx
-user:2:rwx
-user:3:rwx
-user:4:rwx
-user:5:rwx
-user:6:rwx
-user:7:rwx
-user:8:rwx
-user:9:rwx
-user:10:rwx
-user:11:rwx
-user:12:rwx
-user:13:rwx
-user:14:rwx
-user:15:rwx
-user:16:rwx
-user:17:rwx
-user:18:rwx
-user:19:rwx
-user:20:rwx
-group::rwx
-mask::rwx
-other::rwx
-
-xfs acl max
-# file: largeaclfile
-# owner: 0
-# group: 0
-user::rwx
-user:1:rwx
-user:2:rwx
-user:3:rwx
-user:4:rwx
-user:5:rwx
-user:6:rwx
-user:7:rwx
-user:8:rwx
-user:9:rwx
-user:10:rwx
-user:11:rwx
-user:12:rwx
-user:13:rwx
-user:14:rwx
-user:15:rwx
-user:16:rwx
-user:17:rwx
-user:18:rwx
-user:19:rwx
-user:20:rwx
-user:21:rwx
-group::rwx
-mask::rwx
-other::rwx
-
-1 above xfs acl max
-chacl: cannot set access acl on "largeaclfile": Invalid argument
-# file: largeaclfile
-# owner: 0
-# group: 0
-user::rwx
-user:1:rwx
-user:2:rwx
-user:3:rwx
-user:4:rwx
-user:5:rwx
-user:6:rwx
-user:7:rwx
-user:8:rwx
-user:9:rwx
-user:10:rwx
-user:11:rwx
-user:12:rwx
-user:13:rwx
-user:14:rwx
-user:15:rwx
-user:16:rwx
-user:17:rwx
-user:18:rwx
-user:19:rwx
-user:20:rwx
-user:21:rwx
-group::rwx
-mask::rwx
-other::rwx
-
-use 16 aces
-# file: largeaclfile
-# owner: 0
-# group: 0
-user::rwx
-user:1:rwx
-user:2:rwx
-user:3:rwx
-user:4:rwx
-user:5:rwx
-user:6:rwx
-user:7:rwx
-user:8:rwx
-user:9:rwx
-user:10:rwx
-user:11:rwx
-user:12:rwx
-group::rwx
-mask::rwx
-other::rwx
-
-use 17 aces
-# file: largeaclfile
-# owner: 0
-# group: 0
-user::rwx
-user:1:rwx
-user:2:rwx
-user:3:rwx
-user:4:rwx
-user:5:rwx
-user:6:rwx
-user:7:rwx
-user:8:rwx
-user:9:rwx
-user:10:rwx
-user:11:rwx
-user:12:rwx
-user:13:rwx
-group::rwx
-mask::rwx
-other::rwx
-
diff --git a/098 b/098
deleted file mode 100755 (executable)
index 58d2a95..0000000
--- a/098
+++ /dev/null
@@ -1,275 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 098. Modified from UDFQA test 035
-#
-# simple attr tests for EAs:
-#  - set
-#  - get
-#  - list
-#  - remove
-# Basic testing.
-# + udf_db checks.
-# (033 + udf_db)
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-_db_filter()
-{
-    awk '
-       /<file_entry name=/ { fe_on=1 }
-       /<timestamp/  { ts_on=1; next }
-       /<\/timestamp/ { ts_on=0; next }
-       /<cksum/      { next }
-       /<desc_crc/   { next }
-       /<pos/        { next }
-       /<tag_loc/    { next }
-       /<lb_num/     { next }
-       fe_on == 1 && ts_on == 0 { print; next }
-                     { next }
-    '
-}
-
-_umount_check_mount()
-{
-    cd /
-    umount $SCRATCH_MNT
-
-    udf_db -f $SCRATCH_DEV | _db_filter
-
-    _scratch_mount
-    cd $SCRATCH_MNT
-}
-
-# real QA test starts here
-_supported_fs udf
-_supported_os IRIX
-
-_require_scratch
-_require_attrs
-
-_setup_testdir
-
-cd $SCRATCH_MNT
-
-echo "create file foo"
-echo "file_contents" >foo
-cat foo
-
-echo "should be no EAs for foo:"
-${ATTR_PROG} -l foo
-
-echo "set EA <noise,woof>:"
-${ATTR_PROG} -s noise -V woof foo
-
-echo "set EA <colour,blue>:"
-${ATTR_PROG} -s colour -V blue foo
-
-echo "set EA <size,small>:"
-${ATTR_PROG} -s size -V small foo
-
-echo "list the EAs for foo: noise, colour, size" 
-${ATTR_PROG} -l foo
-
-echo "check the list again for foo"
-${ATTR_PROG} -l foo
-
-echo "unmount the FS and see if EAs are persistent"
-_umount_check_mount
-
-echo "check the list again for foo after umount/mount"
-${ATTR_PROG} -l foo
-
-echo "get the value of the noise EA"
-${ATTR_PROG} -g noise foo
-
-echo "get the value of the colour EA which was removed earlier"
-${ATTR_PROG} -g colour foo
-
-echo "get the value of the size EA"
-${ATTR_PROG} -g size foo
-
-echo "remove the colour EA on foo"
-${ATTR_PROG} -r colour foo
-
-echo "list EAs for foo: noise, size"
-${ATTR_PROG} -l foo
-
-echo "get the value of the noise EA"
-${ATTR_PROG} -g noise foo
-
-echo "get the value of the colour EA which was removed earlier"
-${ATTR_PROG} -g colour foo
-
-echo "get the value of the size EA"
-${ATTR_PROG} -g size foo
-
-echo "list all the EAs again: noise, size"
-${ATTR_PROG} -l foo
-
-echo "change the value of the size EA from small to huge"
-${ATTR_PROG} -s size -V huge foo
-
-echo "get the size EA which should now have value huge"
-${ATTR_PROG} -g size foo
-
-echo "list EAs: noise, size"
-${ATTR_PROG} -l foo
-
-echo "remove the size EA from foo"
-${ATTR_PROG} -r size foo
-
-echo "list EAs: noise (size EA has been removed)"
-${ATTR_PROG} -l foo
-
-echo "get the noise EA: woof"
-${ATTR_PROG} -g noise foo
-
-echo "try removing non-existent EA named woof"
-${ATTR_PROG} -r woof foo
-
-echo "try removing already removed EA size"
-${ATTR_PROG} -r size foo
-
-echo "list EAs: noise"
-${ATTR_PROG} -l foo
-
-echo "try removing already removed EA colour"
-${ATTR_PROG} -r colour foo
-
-echo "list EAs: noise"
-${ATTR_PROG} -l foo
-
-echo "remove remaining EA noise"
-${ATTR_PROG} -r noise foo
-
-echo "list EAs: should be no EAs left now"
-${ATTR_PROG} -l foo
-
-echo "unmount the FS and see if EAs are persistent"
-_umount_check_mount
-
-echo "list EAs: should still be no EAs left"
-${ATTR_PROG} -l foo
-
-echo ""
-echo "*** Test out the root namespace ***"
-echo ""
-
-echo "set EA <root:colour,marone>:"
-${ATTR_PROG} -R -s colour -V marone foo
-
-echo "set EA <user:colour,beige>:"
-${ATTR_PROG} -s colour -V beige foo
-
-echo "set EA <user:vomit,pizza>:"
-${ATTR_PROG} -s vomit -V pizza foo
-
-echo "set EA <root:noise,whack>:"
-${ATTR_PROG} -R -s noise -V whack foo
-
-echo "list root EAs: <root:colour,noise>:"
-${ATTR_PROG} -R -l foo
-
-echo "list user EAs: <user:colour,vomit>:"
-${ATTR_PROG} -l foo
-
-echo "get root EA colour: marone"
-${ATTR_PROG} -R -g colour foo
-
-echo "get root EA noise: whack"
-${ATTR_PROG} -R -g noise foo
-
-echo "get root EA vomit which is a user EA => find nothing"
-${ATTR_PROG} -R -g vomit foo
-
-echo ""
-echo "unmount the FS and see if EAs are persistent"
-echo ""
-_umount_check_mount
-
-echo "get root EA colour: marone"
-${ATTR_PROG} -R -g colour foo
-
-echo "get root EA noise: whack"
-${ATTR_PROG} -R -g noise foo
-
-echo "get user EA vomit: pizza" 
-${ATTR_PROG} -g vomit foo
-
-echo "remove the root colour EA"
-${ATTR_PROG} -R -r colour foo
-
-echo "list root EAs: <root:noise>:"
-${ATTR_PROG} -R -l foo
-
-echo "list user EAs: <user:colour,vomit>:"
-${ATTR_PROG} -l foo
-
-echo "remove the final root EA noise"
-${ATTR_PROG} -R -r noise foo
-
-echo "list root EAs: none"
-${ATTR_PROG} -R -l foo
-
-cd /
-umount $SCRATCH_MNT
-
-udf_db -f $SCRATCH_DEV | _db_filter
-
-# Checks the udf filesystem
-_check_udf_filesystem $SCRATCH_DEV
-
-_scratch_mount
-cd $SCRATCH_MNT
-
-echo "delete the file foo - which will delete the associated streams"
-rm foo
-
-cd /
-umount $SCRATCH_MNT
-
-udf_db -f $SCRATCH_DEV | _db_filter
-
-# Checks the udf filesystem
-_check_udf_filesystem $SCRATCH_DEV
-
-# optional stuff if your test has verbose output to help resolve problems
-#echo
-#echo "If failure, check $seq.full (this) and $seq.full.ok (reference)"
-
-# success, all done
-status=0
-exit
diff --git a/098.out b/098.out
deleted file mode 100644 (file)
index 63772a0..0000000
--- a/098.out
+++ /dev/null
@@ -1,1594 +0,0 @@
-QA output created by 098
-create file foo
-file_contents
-should be no EAs for foo:
-set EA <noise,woof>:
-Attribute "noise" set to a 4 byte value for foo:
-woof
-set EA <colour,blue>:
-Attribute "colour" set to a 4 byte value for foo:
-blue
-set EA <size,small>:
-Attribute "size" set to a 5 byte value for foo:
-small
-list the EAs for foo: noise, colour, size
-Attribute "noise" has a 4 byte value for foo
-Attribute "colour" has a 4 byte value for foo
-Attribute "size" has a 5 byte value for foo
-check the list again for foo
-Attribute "noise" has a 4 byte value for foo
-Attribute "colour" has a 4 byte value for foo
-Attribute "size" has a 5 byte value for foo
-unmount the FS and see if EAs are persistent
-    <file_entry name="/">
-        <desc_tag name="tag">
-            <id val="261" />
-            <descriptor_ver val="3" />
-            <reserved val="0" />
-            <serial_num val="0" />
-        </desc_tag>
-        <icb_tag name="icbtag">
-            <prev_num_dirs val="0" />
-            <strat_type val="4" />
-            <strat_param val="0x0 0x0" />
-            <max_num_entries val="1" />
-            <reserved val="0x0" />
-            <file_type val="4" />
-            <lb_addr name="parent_icb">
-                <part_num val="0" />
-            </lb_addr>
-            <flags val="0" />
-        </icb_tag>
-        <uid val="0" />
-        <gid val="0" />
-        <perm val="0x3CA5" />
-        <link_cnt val="1" />
-        <rec_format val="0" />
-        <rec_disp_attr val="0" />
-        <rec_len val="0" />
-        <inf_len val="84" />
-        <logblks_rec val="1" />
-        <ckpoint val="1" />
-        <long_ad name="ex_attr_icb">
-            <len val="0" />
-            <lb_addr name="loc">
-                <part_num val="0" />
-            </lb_addr>
-            <ad_flags val="0" />
-            <ad_id val="0" />
-        </long_ad>
-        <regid name="imp_id">
-            <flags val="0" />
-            <id val="*Silicon Graphics, Inc." />
-            <id_suffix val="\ 4\ 4" />
-        </regid>
-        <unique_id val="0" />
-        <l_ea val="0" />
-        <l_ad val="8" />
-        <short_ad name="ads.sht">
-            <len val="84" />
-        </short_ad>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="10" char=".Parent.Dir." />
-            <l_fi val="0" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="0" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="" />
-        </fileid_desc>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="0" char="....." />
-            <l_fi val="4" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="16" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="foo" comp_id="8" />
-            <extended_file_entry name="foo" comp_id="8">
-                <desc_tag name="tag">
-                    <id val="266" />
-                    <descriptor_ver val="3" />
-                    <reserved val="0" />
-                    <serial_num val="0" />
-                </desc_tag>
-                <icb_tag name="icbtag">
-                    <prev_num_dirs val="0" />
-                    <strat_type val="4" />
-                    <strat_param val="0x0 0x0" />
-                    <max_num_entries val="1" />
-                    <reserved val="0x0" />
-                    <file_type val="5" />
-                    <lb_addr name="parent_icb">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <flags val="0" />
-                </icb_tag>
-                <uid val="0" />
-                <gid val="0" />
-                <perm val="0x1884" />
-                <link_cnt val="2" />
-                <rec_format val="0" />
-                <rec_disp_attr val="0" />
-                <rec_len val="0" />
-                <inf_len val="14" />
-                <obj_size val="27" />
-                <logblks_rec val="1" />
-                <ckpoint val="1" />
-                <long_ad name="ex_attr_icb">
-                    <len val="0" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="0" />
-                </long_ad>
-                <long_ad name="streamdir_icb">
-                    <len val="2048" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="16" />
-                </long_ad>
-                <regid name="imp_id">
-                    <flags val="0" />
-                    <id val="*Silicon Graphics, Inc" />
-                    <id_suffix val="\ 4\ 4" />
-                </regid>
-                <unique_id val="16" />
-                <l_ea val="0" />
-                <l_ad val="8" />
-                <short_ad name="ads.sht">
-                    <len val="14" />
-                </short_ad>
-                <stream_directory>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="8" char=".Parent..." />
-                        <l_fi val="0" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="" />
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="6" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="noise" comp_id="8" />
-                        <file_entry name="noise" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="4" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="4" />
-                            </short_ad>
-                            <file_content>
-                                77 6F 6F 66 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="7" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="colour" comp_id="8" />
-                        <file_entry name="colour" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="4" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="4" />
-                            </short_ad>
-                            <file_content>
-                                62 6C 75 65 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="5" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="size" comp_id="8" />
-                        <file_entry name="size" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="5" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="5" />
-                            </short_ad>
-                            <file_content>
-                                73 6D 6C 6C 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                </stream_directory>
-                <file_content>
-                    66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A 
-                </file_content>
-            </extended_file_entry>
-        </fileid_desc>
-    </file_entry>
-</udf>
-check the list again for foo after umount/mount
-Attribute "noise" has a 4 byte value for foo
-Attribute "colour" has a 4 byte value for foo
-Attribute "size" has a 5 byte value for foo
-get the value of the noise EA
-Attribute "noise" had a 4 byte value for foo:
-woof
-get the value of the colour EA which was removed earlier
-Attribute "colour" had a 4 byte value for foo:
-blue
-get the value of the size EA
-Attribute "size" had a 5 byte value for foo:
-small
-remove the colour EA on foo
-list EAs for foo: noise, size
-Attribute "noise" has a 4 byte value for foo
-Attribute "size" has a 5 byte value for foo
-get the value of the noise EA
-Attribute "noise" had a 4 byte value for foo:
-woof
-get the value of the colour EA which was removed earlier
-attr_get: Attribute not found
-Could not get "colour" for foo
-get the value of the size EA
-Attribute "size" had a 5 byte value for foo:
-small
-list all the EAs again: noise, size
-Attribute "noise" has a 4 byte value for foo
-Attribute "size" has a 5 byte value for foo
-change the value of the size EA from small to huge
-Attribute "size" set to a 4 byte value for foo:
-huge
-get the size EA which should now have value huge
-Attribute "size" had a 4 byte value for foo:
-huge
-list EAs: noise, size
-Attribute "noise" has a 4 byte value for foo
-Attribute "size" has a 4 byte value for foo
-remove the size EA from foo
-list EAs: noise (size EA has been removed)
-Attribute "noise" has a 4 byte value for foo
-get the noise EA: woof
-Attribute "noise" had a 4 byte value for foo:
-woof
-try removing non-existent EA named woof
-attr_remove: Attribute not found
-Could not remove "woof" for foo
-try removing already removed EA size
-attr_remove: Attribute not found
-Could not remove "size" for foo
-list EAs: noise
-Attribute "noise" has a 4 byte value for foo
-try removing already removed EA colour
-attr_remove: Attribute not found
-Could not remove "colour" for foo
-list EAs: noise
-Attribute "noise" has a 4 byte value for foo
-remove remaining EA noise
-list EAs: should be no EAs left now
-unmount the FS and see if EAs are persistent
-    <file_entry name="/">
-        <desc_tag name="tag">
-            <id val="261" />
-            <descriptor_ver val="3" />
-            <reserved val="0" />
-            <serial_num val="0" />
-        </desc_tag>
-        <icb_tag name="icbtag">
-            <prev_num_dirs val="0" />
-            <strat_type val="4" />
-            <strat_param val="0x0 0x0" />
-            <max_num_entries val="1" />
-            <reserved val="0x0" />
-            <file_type val="4" />
-            <lb_addr name="parent_icb">
-                <part_num val="0" />
-            </lb_addr>
-            <flags val="0" />
-        </icb_tag>
-        <uid val="0" />
-        <gid val="0" />
-        <perm val="0x3CA5" />
-        <link_cnt val="1" />
-        <rec_format val="0" />
-        <rec_disp_attr val="0" />
-        <rec_len val="0" />
-        <inf_len val="84" />
-        <logblks_rec val="1" />
-        <ckpoint val="1" />
-        <long_ad name="ex_attr_icb">
-            <len val="0" />
-            <lb_addr name="loc">
-                <part_num val="0" />
-            </lb_addr>
-            <ad_flags val="0" />
-            <ad_id val="0" />
-        </long_ad>
-        <regid name="imp_id">
-            <flags val="0" />
-            <id val="*Silicon Graphics, Inc." />
-            <id_suffix val="\ 4\ 4" />
-        </regid>
-        <unique_id val="0" />
-        <l_ea val="0" />
-        <l_ad val="8" />
-        <short_ad name="ads.sht">
-            <len val="84" />
-        </short_ad>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="10" char=".Parent.Dir." />
-            <l_fi val="0" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="0" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="" />
-        </fileid_desc>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="0" char="....." />
-            <l_fi val="4" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="16" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="foo" comp_id="8" />
-            <file_entry name="foo" comp_id="8">
-                <desc_tag name="tag">
-                    <id val="261" />
-                    <descriptor_ver val="3" />
-                    <reserved val="0" />
-                    <serial_num val="0" />
-                </desc_tag>
-                <icb_tag name="icbtag">
-                    <prev_num_dirs val="0" />
-                    <strat_type val="4" />
-                    <strat_param val="0x0 0x0" />
-                    <max_num_entries val="1" />
-                    <reserved val="0x0" />
-                    <file_type val="5" />
-                    <lb_addr name="parent_icb">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <flags val="0" />
-                </icb_tag>
-                <uid val="0" />
-                <gid val="0" />
-                <perm val="0x1884" />
-                <link_cnt val="1" />
-                <rec_format val="0" />
-                <rec_disp_attr val="0" />
-                <rec_len val="0" />
-                <inf_len val="14" />
-                <logblks_rec val="1" />
-                <ckpoint val="1" />
-                <long_ad name="ex_attr_icb">
-                    <len val="0" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="0" />
-                </long_ad>
-                <regid name="imp_id">
-                    <flags val="0" />
-                    <id val="*Silicon Graphics, Inc" />
-                    <id_suffix val="\ 4\ 4" />
-                </regid>
-                <unique_id val="16" />
-                <l_ea val="0" />
-                <l_ad val="8" />
-                <short_ad name="ads.sht">
-                    <len val="14" />
-                </short_ad>
-                <file_content>
-                    66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A 
-                </file_content>
-            </file_entry>
-        </fileid_desc>
-    </file_entry>
-</udf>
-list EAs: should still be no EAs left
-
-*** Test out the root namespace ***
-
-set EA <root:colour,marone>:
-Attribute "colour" set to a 6 byte value for foo:
-marone
-set EA <user:colour,beige>:
-Attribute "colour" set to a 5 byte value for foo:
-beige
-set EA <user:vomit,pizza>:
-Attribute "vomit" set to a 5 byte value for foo:
-pizza
-set EA <root:noise,whack>:
-Attribute "noise" set to a 5 byte value for foo:
-whack
-list root EAs: <root:colour,noise>:
-Attribute "colour" has a 6 byte value for foo
-Attribute "noise" has a 5 byte value for foo
-list user EAs: <user:colour,vomit>:
-Attribute "colour" has a 5 byte value for foo
-Attribute "vomit" has a 5 byte value for foo
-get root EA colour: marone
-Attribute "colour" had a 6 byte value for foo:
-marone
-get root EA noise: whack
-Attribute "noise" had a 5 byte value for foo:
-whack
-get root EA vomit which is a user EA => find nothing
-attr_get: Attribute not found
-Could not get "vomit" for foo
-
-unmount the FS and see if EAs are persistent
-
-    <file_entry name="/">
-        <desc_tag name="tag">
-            <id val="261" />
-            <descriptor_ver val="3" />
-            <reserved val="0" />
-            <serial_num val="0" />
-        </desc_tag>
-        <icb_tag name="icbtag">
-            <prev_num_dirs val="0" />
-            <strat_type val="4" />
-            <strat_param val="0x0 0x0" />
-            <max_num_entries val="1" />
-            <reserved val="0x0" />
-            <file_type val="4" />
-            <lb_addr name="parent_icb">
-                <part_num val="0" />
-            </lb_addr>
-            <flags val="0" />
-        </icb_tag>
-        <uid val="0" />
-        <gid val="0" />
-        <perm val="0x3CA5" />
-        <link_cnt val="1" />
-        <rec_format val="0" />
-        <rec_disp_attr val="0" />
-        <rec_len val="0" />
-        <inf_len val="84" />
-        <logblks_rec val="1" />
-        <ckpoint val="1" />
-        <long_ad name="ex_attr_icb">
-            <len val="0" />
-            <lb_addr name="loc">
-                <part_num val="0" />
-            </lb_addr>
-            <ad_flags val="0" />
-            <ad_id val="0" />
-        </long_ad>
-        <regid name="imp_id">
-            <flags val="0" />
-            <id val="*Silicon Graphics, Inc." />
-            <id_suffix val="\ 4\ 4" />
-        </regid>
-        <unique_id val="0" />
-        <l_ea val="0" />
-        <l_ad val="8" />
-        <short_ad name="ads.sht">
-            <len val="84" />
-        </short_ad>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="10" char=".Parent.Dir." />
-            <l_fi val="0" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="0" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="" />
-        </fileid_desc>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="0" char="....." />
-            <l_fi val="4" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="16" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="foo" comp_id="8" />
-            <extended_file_entry name="foo" comp_id="8">
-                <desc_tag name="tag">
-                    <id val="266" />
-                    <descriptor_ver val="3" />
-                    <reserved val="0" />
-                    <serial_num val="0" />
-                </desc_tag>
-                <icb_tag name="icbtag">
-                    <prev_num_dirs val="0" />
-                    <strat_type val="4" />
-                    <strat_param val="0x0 0x0" />
-                    <max_num_entries val="1" />
-                    <reserved val="0x0" />
-                    <file_type val="5" />
-                    <lb_addr name="parent_icb">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <flags val="0" />
-                </icb_tag>
-                <uid val="0" />
-                <gid val="0" />
-                <perm val="0x1884" />
-                <link_cnt val="2" />
-                <rec_format val="0" />
-                <rec_disp_attr val="0" />
-                <rec_len val="0" />
-                <inf_len val="14" />
-                <obj_size val="35" />
-                <logblks_rec val="1" />
-                <ckpoint val="1" />
-                <long_ad name="ex_attr_icb">
-                    <len val="0" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="0" />
-                </long_ad>
-                <long_ad name="streamdir_icb">
-                    <len val="2048" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="16" />
-                </long_ad>
-                <regid name="imp_id">
-                    <flags val="0" />
-                    <id val="*Silicon Graphics, Inc" />
-                    <id_suffix val="\ 4\ 4" />
-                </regid>
-                <unique_id val="16" />
-                <l_ea val="0" />
-                <l_ad val="8" />
-                <short_ad name="ads.sht">
-                    <len val="14" />
-                </short_ad>
-                <stream_directory>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="8" char=".Parent..." />
-                        <l_fi val="0" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="" />
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="16" char="Meta...." />
-                        <l_fi val="7" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="colour" comp_id="8" />
-                        <file_entry name="colour" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="6" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="6" />
-                            </short_ad>
-                            <file_content>
-                                6D 61 72 6F 6E 65 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="7" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="colour" comp_id="8" />
-                        <file_entry name="colour" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="5" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="5" />
-                            </short_ad>
-                            <file_content>
-                                62 65 67 65 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="6" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="vomit" comp_id="8" />
-                        <file_entry name="vomit" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="5" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="5" />
-                            </short_ad>
-                            <file_content>
-                                70 69 7A 61 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="16" char="Meta...." />
-                        <l_fi val="6" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="noise" comp_id="8" />
-                        <file_entry name="noise" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="5" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="5" />
-                            </short_ad>
-                            <file_content>
-                                77 68 63 6B 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                </stream_directory>
-                <file_content>
-                    66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A 
-                </file_content>
-            </extended_file_entry>
-        </fileid_desc>
-    </file_entry>
-</udf>
-get root EA colour: marone
-Attribute "colour" had a 6 byte value for foo:
-marone
-get root EA noise: whack
-Attribute "noise" had a 5 byte value for foo:
-whack
-get user EA vomit: pizza
-Attribute "vomit" had a 5 byte value for foo:
-pizza
-remove the root colour EA
-list root EAs: <root:noise>:
-Attribute "noise" has a 5 byte value for foo
-list user EAs: <user:colour,vomit>:
-Attribute "colour" has a 5 byte value for foo
-Attribute "vomit" has a 5 byte value for foo
-remove the final root EA noise
-list root EAs: none
-    <file_entry name="/">
-        <desc_tag name="tag">
-            <id val="261" />
-            <descriptor_ver val="3" />
-            <reserved val="0" />
-            <serial_num val="0" />
-        </desc_tag>
-        <icb_tag name="icbtag">
-            <prev_num_dirs val="0" />
-            <strat_type val="4" />
-            <strat_param val="0x0 0x0" />
-            <max_num_entries val="1" />
-            <reserved val="0x0" />
-            <file_type val="4" />
-            <lb_addr name="parent_icb">
-                <part_num val="0" />
-            </lb_addr>
-            <flags val="0" />
-        </icb_tag>
-        <uid val="0" />
-        <gid val="0" />
-        <perm val="0x3CA5" />
-        <link_cnt val="1" />
-        <rec_format val="0" />
-        <rec_disp_attr val="0" />
-        <rec_len val="0" />
-        <inf_len val="84" />
-        <logblks_rec val="1" />
-        <ckpoint val="1" />
-        <long_ad name="ex_attr_icb">
-            <len val="0" />
-            <lb_addr name="loc">
-                <part_num val="0" />
-            </lb_addr>
-            <ad_flags val="0" />
-            <ad_id val="0" />
-        </long_ad>
-        <regid name="imp_id">
-            <flags val="0" />
-            <id val="*Silicon Graphics, Inc." />
-            <id_suffix val="\ 4\ 4" />
-        </regid>
-        <unique_id val="0" />
-        <l_ea val="0" />
-        <l_ad val="8" />
-        <short_ad name="ads.sht">
-            <len val="84" />
-        </short_ad>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="10" char=".Parent.Dir." />
-            <l_fi val="0" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="0" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="" />
-        </fileid_desc>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="0" char="....." />
-            <l_fi val="4" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="16" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="foo" comp_id="8" />
-            <extended_file_entry name="foo" comp_id="8">
-                <desc_tag name="tag">
-                    <id val="266" />
-                    <descriptor_ver val="3" />
-                    <reserved val="0" />
-                    <serial_num val="0" />
-                </desc_tag>
-                <icb_tag name="icbtag">
-                    <prev_num_dirs val="0" />
-                    <strat_type val="4" />
-                    <strat_param val="0x0 0x0" />
-                    <max_num_entries val="1" />
-                    <reserved val="0x0" />
-                    <file_type val="5" />
-                    <lb_addr name="parent_icb">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <flags val="0" />
-                </icb_tag>
-                <uid val="0" />
-                <gid val="0" />
-                <perm val="0x1884" />
-                <link_cnt val="2" />
-                <rec_format val="0" />
-                <rec_disp_attr val="0" />
-                <rec_len val="0" />
-                <inf_len val="14" />
-                <obj_size val="24" />
-                <logblks_rec val="1" />
-                <ckpoint val="1" />
-                <long_ad name="ex_attr_icb">
-                    <len val="0" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="0" />
-                </long_ad>
-                <long_ad name="streamdir_icb">
-                    <len val="2048" />
-                    <lb_addr name="loc">
-                        <part_num val="0" />
-                    </lb_addr>
-                    <ad_flags val="0" />
-                    <ad_id val="16" />
-                </long_ad>
-                <regid name="imp_id">
-                    <flags val="0" />
-                    <id val="*Silicon Graphics, Inc" />
-                    <id_suffix val="\ 4\ 4" />
-                </regid>
-                <unique_id val="16" />
-                <l_ea val="0" />
-                <l_ad val="8" />
-                <short_ad name="ads.sht">
-                    <len val="14" />
-                </short_ad>
-                <stream_directory>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="8" char=".Parent..." />
-                        <l_fi val="0" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="" />
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="20" char="Meta.Deleted.." />
-                        <l_fi val="7" />
-                        <long_ad name="icb">
-                            <len val="0" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="0" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="colour" comp_id="254" />
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="7" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="colour" comp_id="8" />
-                        <file_entry name="colour" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="5" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="5" />
-                            </short_ad>
-                            <file_content>
-                                62 65 67 65 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="0" char="....." />
-                        <l_fi val="6" />
-                        <long_ad name="icb">
-                            <len val="2048" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="16" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="vomit" comp_id="8" />
-                        <file_entry name="vomit" comp_id="8">
-                            <desc_tag name="tag">
-                                <id val="261" />
-                                <descriptor_ver val="3" />
-                                <reserved val="0" />
-                                <serial_num val="0" />
-                            </desc_tag>
-                            <icb_tag name="icbtag">
-                                <prev_num_dirs val="0" />
-                                <strat_type val="4" />
-                                <strat_param val="0x0 0x0" />
-                                <max_num_entries val="1" />
-                                <reserved val="0x0" />
-                                <file_type val="5" />
-                                <lb_addr name="parent_icb">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <flags val="8192" />
-                            </icb_tag>
-                            <uid val="0" />
-                            <gid val="0" />
-                            <perm val="0x1884" />
-                            <link_cnt val="1" />
-                            <rec_format val="0" />
-                            <rec_disp_attr val="0" />
-                            <rec_len val="0" />
-                            <inf_len val="5" />
-                            <logblks_rec val="1" />
-                            <ckpoint val="1" />
-                            <long_ad name="ex_attr_icb">
-                                <len val="0" />
-                                <lb_addr name="loc">
-                                    <part_num val="0" />
-                                </lb_addr>
-                                <ad_flags val="0" />
-                                <ad_id val="0" />
-                            </long_ad>
-                            <regid name="imp_id">
-                                <flags val="0" />
-                                <id val="*Silicon Graphics, Inc" />
-                                <id_suffix val="\ 4\ 4" />
-                            </regid>
-                            <unique_id val="16" />
-                            <l_ea val="0" />
-                            <l_ad val="8" />
-                            <short_ad name="ads.sht">
-                                <len val="5" />
-                            </short_ad>
-                            <file_content>
-                                70 69 7A 61 
-                            </file_content>
-                        </file_entry>
-                    </fileid_desc>
-                    <fileid_desc>
-                        <desc_tag name="tag">
-                            <id val="257" />
-                            <descriptor_ver val="3" />
-                            <reserved val="0" />
-                            <serial_num val="0" />
-                        </desc_tag>
-                        <file_num val="1" />
-                        <file_char val="20" char="Meta.Deleted.." />
-                        <l_fi val="6" />
-                        <long_ad name="icb">
-                            <len val="0" />
-                            <lb_addr name="loc">
-                                <part_num val="0" />
-                            </lb_addr>
-                            <ad_flags val="0" />
-                            <ad_id val="0" />
-                        </long_ad>
-                        <l_iu val="0" />
-                        <file_id name="noise" comp_id="254" />
-                </stream_directory>
-                <file_content>
-                    66 69 6C 65 5F 63 6F 6E 74 65 6E 74 73 A 
-                </file_content>
-            </extended_file_entry>
-        </fileid_desc>
-    </file_entry>
-</udf>
-delete the file foo - which will delete the associated streams
-    <file_entry name="/">
-        <desc_tag name="tag">
-            <id val="261" />
-            <descriptor_ver val="3" />
-            <reserved val="0" />
-            <serial_num val="0" />
-        </desc_tag>
-        <icb_tag name="icbtag">
-            <prev_num_dirs val="0" />
-            <strat_type val="4" />
-            <strat_param val="0x0 0x0" />
-            <max_num_entries val="1" />
-            <reserved val="0x0" />
-            <file_type val="4" />
-            <lb_addr name="parent_icb">
-                <part_num val="0" />
-            </lb_addr>
-            <flags val="0" />
-        </icb_tag>
-        <uid val="0" />
-        <gid val="0" />
-        <perm val="0x3CA5" />
-        <link_cnt val="1" />
-        <rec_format val="0" />
-        <rec_disp_attr val="0" />
-        <rec_len val="0" />
-        <inf_len val="84" />
-        <logblks_rec val="1" />
-        <ckpoint val="1" />
-        <long_ad name="ex_attr_icb">
-            <len val="0" />
-            <lb_addr name="loc">
-                <part_num val="0" />
-            </lb_addr>
-            <ad_flags val="0" />
-            <ad_id val="0" />
-        </long_ad>
-        <regid name="imp_id">
-            <flags val="0" />
-            <id val="*Silicon Graphics, Inc." />
-            <id_suffix val="\ 4\ 4" />
-        </regid>
-        <unique_id val="0" />
-        <l_ea val="0" />
-        <l_ad val="8" />
-        <short_ad name="ads.sht">
-            <len val="84" />
-        </short_ad>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="10" char=".Parent.Dir." />
-            <l_fi val="0" />
-            <long_ad name="icb">
-                <len val="2048" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="0" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="" />
-        </fileid_desc>
-        <fileid_desc>
-            <desc_tag name="tag">
-                <id val="257" />
-                <descriptor_ver val="3" />
-                <reserved val="0" />
-                <serial_num val="0" />
-            </desc_tag>
-            <file_num val="1" />
-            <file_char val="4" char="..Deleted.." />
-            <l_fi val="4" />
-            <long_ad name="icb">
-                <len val="0" />
-                <lb_addr name="loc">
-                    <part_num val="0" />
-                </lb_addr>
-                <ad_flags val="0" />
-                <ad_id val="0" />
-            </long_ad>
-            <l_iu val="0" />
-            <file_id name="foo" comp_id="254" />
-    </file_entry>
-</udf>
diff --git a/101 b/101
deleted file mode 100755 (executable)
index 0d274e5..0000000
--- a/101
+++ /dev/null
@@ -1,61 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 101. Modified from UDFQA test 029. 
-#
-# This tests mkfs_udf with -s [SIZE] option. 
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-FS_SIZE=2048
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-_supported_fs udf 
-_supported_os IRIX
-
-MKFS_OPTIONS="-s $FS_SIZE"
-
-_require_scratch
-_setup_udf_scratchdir
-umount $SCRATCH_MNT
-
-# Inspect the space bitmap
-echo bitmap | udf_db -c - $SCRATCH_DEV
-
-# Run udf_test
-_check_udf_filesystem $SCRATCH_DEV $FS_SIZE
-
-# success, all done
-status=0
-exit
diff --git a/101.out b/101.out
deleted file mode 100644 (file)
index 1ca59a8..0000000
--- a/101.out
+++ /dev/null
@@ -1,19 +0,0 @@
-QA output created by 101
-    <space_bitmap name="unalloc">
-        <desc_tag name="tag">
-            <id val="264" />
-            <descriptor_ver val="3" />
-            <cksum val="13" />
-            <reserved val="0" />
-            <serial_num val="0" />
-            <desc_crc val="0" />
-            <desc_crc_len val="0" />
-            <tag_loc val="1" />
-        </desc_tag>
-        <num_bits val="1500" />
-        <num_bytes val="188" />
-        <bitmap>
-            0-3 [4]: 0
-            4-1499 [1496]: 1
-        </bitmap>
-    </space_bitmap>
diff --git a/102 b/102
deleted file mode 100755 (executable)
index 68407a7..0000000
--- a/102
+++ /dev/null
@@ -1,58 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 102
-#
-# This tests mkfs_udf/mkudffs and the device detection code
-# Modified from UDFQA test 031.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    rm -f $tmp.*
-    cd /
-    _cleanup_testdir
-}
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-_supported_fs udf 
-_supported_os Linux IRIX
-
-_require_scratch
-_setup_udf_scratchdir
-
-# Checks the udf filesystem
-_check_udf_filesystem $SCRATCH_DEV
-
-echo "Finished"
-
-# success, all done
-status=0
-exit
diff --git a/102.out b/102.out
deleted file mode 100644 (file)
index bce1a19..0000000
--- a/102.out
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 102
-Finished
diff --git a/177 b/177
deleted file mode 100755 (executable)
index ec8aca7..0000000
--- a/177
+++ /dev/null
@@ -1,84 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 177
-#
-# Test to reproduce PV#: 964316
-# Check sync reclaims and flushes unlinked inodes to their buffers.
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2007 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.dmapi
-
-# real QA test starts here
-
-# Modify as appropriate.
-_supported_fs xfs 
-_supported_os Linux
-
-# Setup Filesystem
-_require_scratch
-
-# test that we have DMAPI support
-_dmapi_scratch_mount
-umount $SCRATCH_MNT > /dev/null 2>&1
-
-_scratch_mkfs_xfs >/dev/null 2>&1 \
-        || _fail "mkfs failed"
-
-_scratch_mount \
-        || _fail "mount failed"
-
-# run Mark Goodwin test here
-# Usage: ./bulkstat_unlink_test iterations nfiles stride dir
-#        Create dir with nfiles, unlink each stride'th file, sync, bulkstat
-echo "Start original bulkstat_unlink_test"
-$here/src/bulkstat_unlink_test 10 100 1 $SCRATCH_MNT/bulkstat
-$here/src/bulkstat_unlink_test 10 1000 1 $SCRATCH_MNT/bulkstat
-$here/src/bulkstat_unlink_test 15 100 6 $SCRATCH_MNT/bulkstat
-$here/src/bulkstat_unlink_test 20 1000 3 $SCRATCH_MNT/bulkstat
-
-# Mount scratch with ikeep enabled
-umount $SCRATCH_MNT
-_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT" \
-        || _fail "mount failed"
-
-echo "Start bulkstat_unlink_test_modified"
-$here/src/bulkstat_unlink_test_modified 10 1000 1 $SCRATCH_MNT/bulkstat
-
-
-# success, all done
-status=0
-exit
diff --git a/177.out b/177.out
deleted file mode 100644 (file)
index ba3be1e..0000000
--- a/177.out
+++ /dev/null
@@ -1,88 +0,0 @@
-QA output created by 177
-Start original bulkstat_unlink_test
-Iteration 0 ... (100 files)passed
-Iteration 1 ... (100 files)passed
-Iteration 2 ... (100 files)passed
-Iteration 3 ... (100 files)passed
-Iteration 4 ... (100 files)passed
-Iteration 5 ... (100 files)passed
-Iteration 6 ... (100 files)passed
-Iteration 7 ... (100 files)passed
-Iteration 8 ... (100 files)passed
-Iteration 9 ... (100 files)passed
-Iteration 0 ... (1000 files)passed
-Iteration 1 ... (1000 files)passed
-Iteration 2 ... (1000 files)passed
-Iteration 3 ... (1000 files)passed
-Iteration 4 ... (1000 files)passed
-Iteration 5 ... (1000 files)passed
-Iteration 6 ... (1000 files)passed
-Iteration 7 ... (1000 files)passed
-Iteration 8 ... (1000 files)passed
-Iteration 9 ... (1000 files)passed
-Iteration 0 ... (100 files)passed
-Iteration 1 ... (100 files)passed
-Iteration 2 ... (100 files)passed
-Iteration 3 ... (100 files)passed
-Iteration 4 ... (100 files)passed
-Iteration 5 ... (100 files)passed
-Iteration 6 ... (100 files)passed
-Iteration 7 ... (100 files)passed
-Iteration 8 ... (100 files)passed
-Iteration 9 ... (100 files)passed
-Iteration 10 ... (100 files)passed
-Iteration 11 ... (100 files)passed
-Iteration 12 ... (100 files)passed
-Iteration 13 ... (100 files)passed
-Iteration 14 ... (100 files)passed
-Iteration 0 ... (1000 files)passed
-Iteration 1 ... (1000 files)passed
-Iteration 2 ... (1000 files)passed
-Iteration 3 ... (1000 files)passed
-Iteration 4 ... (1000 files)passed
-Iteration 5 ... (1000 files)passed
-Iteration 6 ... (1000 files)passed
-Iteration 7 ... (1000 files)passed
-Iteration 8 ... (1000 files)passed
-Iteration 9 ... (1000 files)passed
-Iteration 10 ... (1000 files)passed
-Iteration 11 ... (1000 files)passed
-Iteration 12 ... (1000 files)passed
-Iteration 13 ... (1000 files)passed
-Iteration 14 ... (1000 files)passed
-Iteration 15 ... (1000 files)passed
-Iteration 16 ... (1000 files)passed
-Iteration 17 ... (1000 files)passed
-Iteration 18 ... (1000 files)passed
-Iteration 19 ... (1000 files)passed
-Start bulkstat_unlink_test_modified
-Iteration 0 ... 
-testFiles 1000 ... 
-passed
-Iteration 1 ... 
-testFiles 1000 ... 
-passed
-Iteration 2 ... 
-testFiles 1000 ... 
-passed
-Iteration 3 ... 
-testFiles 1000 ... 
-passed
-Iteration 4 ... 
-testFiles 1000 ... 
-passed
-Iteration 5 ... 
-testFiles 1000 ... 
-passed
-Iteration 6 ... 
-testFiles 1000 ... 
-passed
-Iteration 7 ... 
-testFiles 1000 ... 
-passed
-Iteration 8 ... 
-testFiles 1000 ... 
-passed
-Iteration 9 ... 
-testFiles 1000 ... 
-passed
diff --git a/218 b/218
deleted file mode 100755 (executable)
index 4b46452..0000000
--- a/218
+++ /dev/null
@@ -1,94 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 218
-#
-# Basic defragmentation sanity tests
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2009 Eric Sandeen.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-    _cleanup_testdir
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.defrag
-
-# real QA test starts here
-_supported_fs xfs ext4 btrfs
-_supported_os Linux
-
-_setup_testdir
-# We require scratch so that we'll have free contiguous space
-_require_scratch
-_scratch_mkfs >/dev/null 2>&1
-_scratch_mount
-
-_require_defrag
-
-fragfile=$SCRATCH_MNT/fragfile.$$
-
-rm -f $fragfile
-
-# Craft some fragmented files, defrag them, check the result.
-
-echo "zero-length file:" | tee -a $seq.full
-touch $fragfile
-_defrag $fragfile
-
-echo "Sparse file (no blocks):" | tee -a $seq.full
-xfs_io -F -f -c "truncate 1m" $fragfile
-_defrag $fragfile
-
-echo "Contiguous file:" | tee -a $seq.full
-dd if=/dev/zero of=$fragfile bs=4k count=4 &>/dev/null
-_defrag $fragfile
-
-echo "Write backwards sync, but contiguous - should defrag to 1 extent" | tee -a $seq.full
-for I in `seq 9 -1 0`; do
-       dd if=/dev/zero of=$fragfile bs=4k count=1 conv=notrunc seek=$I oflag=sync &>/dev/null
-done
-_defrag $fragfile
-
-echo "Write backwards sync leaving holes - defrag should do nothing" | tee -a $seq.full
-for I in `seq 31 -2 0`; do
-       dd if=/dev/zero of=$fragfile bs=4k count=1 conv=notrunc seek=$I oflag=sync &>/dev/null
-done
-_defrag $fragfile
-
-echo "Write forwards sync leaving holes - defrag should do nothing" | tee -a $seq.full
-for I in `seq 0 2 31`; do
-       dd if=/dev/zero of=$fragfile bs=4k count=1 conv=notrunc seek=$I oflag=sync &>/dev/null
-done
-_defrag $fragfile
-
-rm -f $seq.full
-status=0
-exit
diff --git a/218.out b/218.out
deleted file mode 100644 (file)
index 7559cdd..0000000
--- a/218.out
+++ /dev/null
@@ -1,19 +0,0 @@
-QA output created by 218
-zero-length file:
-Before: 0
-After: 0
-Sparse file (no blocks):
-Before: 0
-After: 0
-Contiguous file:
-Before: 1
-After: 1
-Write backwards sync, but contiguous - should defrag to 1 extent
-Before: 10
-After: 1
-Write backwards sync leaving holes - defrag should do nothing
-Before: 16
-After: 16
-Write forwards sync leaving holes - defrag should do nothing
-Before: 16
-After: 16
diff --git a/243 b/243
deleted file mode 100755 (executable)
index 6a1b6d7..0000000
--- a/243
+++ /dev/null
@@ -1,179 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 243
-#
-# Test to ensure that the EOFBLOCK_FL gets set/unset correctly.
-#
-# As found by Theodore Ts'o:
-# If a 128K file is falloc'ed using the KEEP_SIZE flag, and then
-# write exactly 128K, the EOFBLOCK_FL doesn't get cleared correctly.
-# This is bad since it forces e2fsck to complain about that inode.
-# If you have a large number of inodes that are written with fallocate
-# using KEEP_SIZE, and then fill them up to their expected size,
-# e2fsck will potentially complain about a _huge_ number of inodes.
-# This would also cause a huge increase in the time taken by e2fsck
-# to complete its check.
-#
-# Test scenarios covered:
-# 1. Fallocating X bytes and writing Y (Y<X) (buffered and direct io)
-# 2. Fallocating X bytes and writing Y (Y=X) (buffered and direct io)
-# 3. Fallocating X bytes and writing Y (Y>X) (buffered and direct io)
-#
-# These test cases exercise the normal and edge case conditions using
-# falloc (and KEEP_SIZE).
-#
-# Ref: http://thread.gmane.org/gmane.comp.file-systems.ext4/20682
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2010 Google, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1        # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# Test specific macros.
-BIT_NOT_SET=0   # inode flag - 0x400000 bit is not set.
-BIT_SET=1       # inode flag - 0x400000 bit is set.
-
-# Generic test cleanup function.
-_cleanup()
-{
-  cd /
-  rm -f $tmp.*
-}
-
-# Ext4 uses the EOFBLOCKS_FL bit when fallocating blocks with KEEP_SIZE
-# enabled. The only time this bit should be set is when extending the allocated
-# blocks further than what the i_size represents. In the situations wherein the
-# i_size covers all allocated blocks, this bit should be cleared.
-
-# Checks the state of the sample file in the filesystem and returns whether
-# the inode flag 0x400000 is set or not.
-_check_ext4_eof_flag()
-{
-  # Check whether EOFBLOCK_FL is set.
-  # For ext4 filesystems: use debugfs to check if EOFBLOCKS_FL is set.
-  # Other filesystems: do nothing. The default fsck at the end of the test
-  # should catch any potential errors.
-  if [ "${FSTYP}" == "ext4" ]; then
-    bit_set=1
-
-    # Unmount the ${TEST_DEV}
-    umount ${TEST_DEV}
-
-    # Run debugfs to gather file_parameters - specifically iflags.
-    file_params=`debugfs ${TEST_DEV} -R "stat ${1}" 2>&1 | grep -e Flags:`
-    iflags=${file_params#*Flags: }
-
-    # Ensure that the iflags value was parsed correctly.
-    if [ -z ${iflags} ]; then
-      echo "iFlags value was not parsed successfully." >> $seq.full
-      status=1
-      exit ${status}
-    fi
-
-    # Check if EOFBLOCKS_FL is set.
-    if ((${iflags} & 0x400000)); then
-      echo "EOFBLOCK_FL bit is set." >> $seq.full
-      bit_set=1
-    else
-      echo "EOFBLOCK_FL bit is not set." >> $seq.full
-      bit_set=0
-    fi
-
-    # Check current bit state to expected value.
-    if [ ${bit_set} -ne ${2} ]; then
-      echo "Error: Current bit state incorrect." >> $seq.full
-      status=1
-      exit ${status}
-    fi
-
-    # Mount the ${TEST_DEV}
-    mount ${TEST_DEV} -t ${FSTYP} ${TEST_DIR}
-  fi
-}
-
-# Get standard environment, filters and checks.
-. ./common.rc
-. ./common.filter
-
-# Prerequisites for the test run.
-_supported_fs ext4 xfs btrfs gfs2
-_supported_os Linux
-_require_xfs_io_falloc
-
-# Real QA test starts here.
-rm -f $seq.full
-
-# Remove any leftover files from last run.
-rm -f ${TEST_DIR}/test_?
-
-# Begin test cases.
-echo "Test 1: Fallocate 40960 bytes and write 4096 bytes (buffered io)." \
-    >> $seq.full
-${XFS_IO_PROG} -F -f                    \
-    -c 'falloc -k 0 40960'              \
-    -c 'pwrite 0 4096'                  \
-    ${TEST_DIR}/test_1 | _filter_xfs_io_unique
-_check_ext4_eof_flag test_1 ${BIT_SET}
-
-echo "Test 2: Fallocate 40960 bytes and write 4096 bytes (direct io)." \
-    >> $seq.full
-${XFS_IO_PROG} -F -f -d                 \
-    -c 'falloc -k 0 40960'              \
-    -c 'pwrite 0 4096'                  \
-    ${TEST_DIR}/test_2 | _filter_xfs_io_unique
-_check_ext4_eof_flag test_2 ${BIT_SET}
-
-echo "Test 3: Fallocate 40960 bytes and write 40960 bytes (buffered io)." \
-    >> $seq.full
-${XFS_IO_PROG} -F -f                    \
-    -c 'falloc -k 0 40960'              \
-    -c 'pwrite 0 40960'                 \
-    ${TEST_DIR}/test_3 | _filter_xfs_io_unique
-_check_ext4_eof_flag test_3 ${BIT_NOT_SET}
-
-echo "Test 4: Fallocate 40960 bytes and write 40960 bytes (direct io)." \
-    >> $seq.full
-${XFS_IO_PROG} -F -f -d                 \
-    -c 'falloc -k 0 40960'              \
-    -c 'pwrite 0 40960'                 \
-    ${TEST_DIR}/test_4 | _filter_xfs_io_unique
-_check_ext4_eof_flag test_4 ${BIT_NOT_SET}
-
-echo "Test 5: Fallocate 128k, seek 256k and write 4k block (buffered io)." \
-    >> $seq.full
-${XFS_IO_PROG} -F -f                    \
-    -c 'falloc -k 0 128k'               \
-    -c 'pwrite 256k 4k'                 \
-    ${TEST_DIR}/test_5 | _filter_xfs_io_unique
-_check_ext4_eof_flag test_5 ${BIT_NOT_SET}
-
-echo "Test 6: Fallocate 128k, seek to 256k and write a 4k block (direct io)." \
-    >> $seq.full
-${XFS_IO_PROG} -F -f -d                 \
-    -c 'falloc -k 0 128k'               \
-    -c 'pwrite 256k 4k'                 \
-    ${TEST_DIR}/test_6 | _filter_xfs_io_unique
-_check_ext4_eof_flag test_6 ${BIT_NOT_SET}
-
-status=0
-exit ${status}
diff --git a/243.out b/243.out
deleted file mode 100644 (file)
index 290a005..0000000
--- a/243.out
+++ /dev/null
@@ -1,13 +0,0 @@
-QA output created by 243
-wrote 4096/4096 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 40960/40960 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 40960/40960 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 262144
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 4096/4096 bytes at offset 262144
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/252 b/252
deleted file mode 100755 (executable)
index 9f0424d..0000000
--- a/252
+++ /dev/null
@@ -1,65 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 252
-#
-# Test fallocate hole punching
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2010 Red Hat.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-
-_cleanup()
-{
-    rm -f $tmp.*
-}
-
-trap "_cleanup ; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.punch
-
-# real QA test starts here
-_supported_fs xfs 
-_supported_os Linux
-
-_require_xfs_io_falloc_punch
-_require_xfs_io_fiemap
-
-testfile=$TEST_DIR/252.$$
-
-# Standard punch hole tests
-_test_generic_punch falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
-
-# Delayed allocation punch hole tests
-_test_generic_punch -d falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
-
-# Multi hole punch tests
-_test_generic_punch -k falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
-
-# Delayed allocation multi punch hole tests
-_test_generic_punch -d -k falloc fpunch fpunch fiemap _filter_fiemap $testfile -F
-
-status=0 ; exit
diff --git a/252.out b/252.out
deleted file mode 100644 (file)
index 3caf9d6..0000000
--- a/252.out
+++ /dev/null
@@ -1,307 +0,0 @@
-QA output created by 252
-       1. into a hole
-daa100df6e6711906b61c9ab5aa16032
-       2. into allocated space
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       3. into unwritten space
-0: [0..7]: unwritten
-1: [8..23]: hole
-2: [24..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-       4. hole -> data
-0: [0..23]: hole
-1: [24..31]: data
-2: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-       5. hole -> unwritten
-0: [0..23]: hole
-1: [24..31]: unwritten
-2: [32..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-       6. data -> hole
-0: [0..7]: data
-1: [8..39]: hole
-1b3779878366498b28c702ef88c4a773
-       7. data -> unwritten
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..31]: unwritten
-3: [32..39]: hole
-1b3779878366498b28c702ef88c4a773
-       8. unwritten -> hole
-0: [0..7]: unwritten
-1: [8..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-       9. unwritten -> data
-0: [0..7]: unwritten
-1: [8..23]: hole
-2: [24..31]: data
-3: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-       10. hole -> data -> hole
-daa100df6e6711906b61c9ab5aa16032
-       11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       12. unwritten -> data -> unwritten
-0: [0..7]: unwritten
-1: [8..31]: hole
-2: [32..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-       13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: hole
-e1f024eedd27ea6b1c3e9b841c850404
-       15. data -> hole @ 0
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       16. data -> cache cold ->hole
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       17. data -> hole in single block file
-0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
-       1. into a hole
-daa100df6e6711906b61c9ab5aa16032
-       2. into allocated space
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       3. into unwritten space
-0: [0..7]: unwritten
-1: [8..23]: hole
-2: [24..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-       4. hole -> data
-0: [0..23]: hole
-1: [24..31]: data
-2: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-       5. hole -> unwritten
-0: [0..23]: hole
-1: [24..31]: unwritten
-2: [32..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-       6. data -> hole
-0: [0..7]: data
-1: [8..39]: hole
-1b3779878366498b28c702ef88c4a773
-       7. data -> unwritten
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..31]: unwritten
-3: [32..39]: hole
-1b3779878366498b28c702ef88c4a773
-       8. unwritten -> hole
-0: [0..7]: unwritten
-1: [8..39]: hole
-daa100df6e6711906b61c9ab5aa16032
-       9. unwritten -> data
-0: [0..7]: unwritten
-1: [8..23]: hole
-2: [24..31]: data
-3: [32..39]: hole
-cc63069677939f69a6e8f68cae6a6dac
-       10. hole -> data -> hole
-daa100df6e6711906b61c9ab5aa16032
-       11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       12. unwritten -> data -> unwritten
-0: [0..7]: unwritten
-1: [8..31]: hole
-2: [32..39]: unwritten
-daa100df6e6711906b61c9ab5aa16032
-       13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: hole
-e1f024eedd27ea6b1c3e9b841c850404
-       15. data -> hole @ 0
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       16. data -> cache cold ->hole
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       17. data -> hole in single block file
-0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
-       1. into a hole
-0: [0..7]: data
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
-       2. into allocated space
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       3. into unwritten space
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       4. hole -> data
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       5. hole -> unwritten
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       6. data -> hole
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       7. data -> unwritten
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       8. unwritten -> hole
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       9. unwritten -> data
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       10. hole -> data -> hole
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       12. unwritten -> data -> unwritten
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: hole
-e1f024eedd27ea6b1c3e9b841c850404
-       15. data -> hole @ 0
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       16. data -> cache cold ->hole
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       17. data -> hole in single block file
-0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
-       1. into a hole
-0: [0..7]: data
-1: [8..39]: hole
-5a58e46082be047d0f13bee7974015b9
-       2. into allocated space
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       3. into unwritten space
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       4. hole -> data
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       5. hole -> unwritten
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       6. data -> hole
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       7. data -> unwritten
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       8. unwritten -> hole
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       9. unwritten -> data
-0: [0..7]: data
-1: [8..23]: hole
-2: [24..39]: data
-cc58a7417c2d7763adc45b6fcd3fa024
-       10. hole -> data -> hole
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       11. data -> hole -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       12. unwritten -> data -> unwritten
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       13. data -> unwritten -> data
-0: [0..7]: data
-1: [8..31]: hole
-2: [32..39]: data
-f6aeca13ec49e5b266cd1c913cd726e3
-       14. data -> hole @ EOF
-0: [0..23]: data
-1: [24..39]: hole
-e1f024eedd27ea6b1c3e9b841c850404
-       15. data -> hole @ 0
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       16. data -> cache cold ->hole
-0: [0..15]: hole
-1: [16..39]: data
-eecb7aa303d121835de05028751d301c
-       17. data -> hole in single block file
-0: [0..7]: data
-13535fd4d496bf0b74bb2335aa4d1b31
diff --git a/254 b/254
deleted file mode 100755 (executable)
index 73089d1..0000000
--- a/254
+++ /dev/null
@@ -1,106 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 254
-#
-# Test btrfs's subvolume and snapshot support
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2011 Red Hat.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-
-_cleanup()
-{
-    rm -f $tmp.*
-}
-
-trap "_cleanup ; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-_supported_fs btrfs
-_supported_os Linux
-_require_scratch
-
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount
-
-# First test basic snapshotting
-echo "Creating file foo in root dir"
-dd if=/dev/zero of=$SCRATCH_MNT/foo bs=1M count=1 &> /dev/null
-echo "List root dir"
-ls $SCRATCH_MNT
-echo "Creating snapshot of root dir"
-btrfs subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch
-echo "List root dir after snapshot"
-ls $SCRATCH_MNT
-echo "List snapshot dir"
-ls $SCRATCH_MNT/snap
-rm -f $SCRATCH_MNT/foo
-echo "List root dir after rm of foo"
-ls $SCRATCH_MNT
-echo "List snapshot dir"
-ls $SCRATCH_MNT/snap
-
-# Test creating a normal subvolme
-btrfs subvolume create $SCRATCH_MNT/subvol | _filter_scratch
-echo "Listing root dir"
-ls $SCRATCH_MNT
-echo "Listing subvol"
-ls $SCRATCH_MNT/subvol
-
-# Test setting a default mount
-echo "Creating file bar in subvol"
-dd if=/dev/zero of=$SCRATCH_MNT/subvol/bar bs=1M count=1 &> /dev/null
-echo "Setting subvol to the default"
-btrfs subvolume set-default 0 $SCRATCH_MNT/subvol | _filter_scratch
-_scratch_remount
-echo "List root dir which is now subvol"
-ls $SCRATCH_MNT
-_scratch_unmount
-echo "Mounting sbuvolid=0 for the root dir"
-_scratch_mount "-o subvolid=0"
-echo "List root dir"
-ls $SCRATCH_MNT
-echo "Setting the root dir as the default again"
-btrfs subvolume set-default 0 $SCRATCH_MNT | _filter_scratch
-_scratch_remount
-echo "List root dir"
-ls $SCRATCH_MNT
-
-# Test listing the subvolumes
-echo "Listing subvolumes"
-btrfs subvolume list $SCRATCH_MNT | awk '{ print $NF }'
-
-# Delete the snapshot
-btrfs subvolume delete $SCRATCH_MNT/snap | _filter_scratch
-echo "List root dir"
-ls $SCRATCH_MNT
-_scratch_remount
-echo "List root dir"
-ls $SCRATCH_MNT
-
-status=0 ; exit
diff --git a/254.out b/254.out
deleted file mode 100644 (file)
index d4b5346..0000000
--- a/254.out
+++ /dev/null
@@ -1,40 +0,0 @@
-QA output created by 254
-Creating file foo in root dir
-List root dir
-foo
-Creating snapshot of root dir
-Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'
-List root dir after snapshot
-foo
-snap
-List snapshot dir
-foo
-List root dir after rm of foo
-snap
-List snapshot dir
-foo
-Create subvolume 'SCRATCH_MNT/subvol'
-Listing root dir
-snap
-subvol
-Listing subvol
-Creating file bar in subvol
-Setting subvol to the default
-List root dir which is now subvol
-bar
-Mounting sbuvolid=0 for the root dir
-List root dir
-snap
-subvol
-Setting the root dir as the default again
-List root dir
-snap
-subvol
-Listing subvolumes
-snap
-subvol
-Delete subvolume 'SCRATCH_MNT/snap'
-List root dir
-subvol
-List root dir
-subvol
diff --git a/264 b/264
deleted file mode 100755 (executable)
index a589c7c..0000000
--- a/264
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/bin/bash
-# FS QA Test No. 264
-#
-# Extented btrfs snapshot test cases
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2011 Oracle  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-
-_cleanup()
-{
-    rm -f $tmp.*
-}
-
-trap "_cleanup ; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-_need_to_be_root
-_supported_fs btrfs
-_supported_os Linux
-_require_scratch
-
-_scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
-_scratch_mount
-
-# Create and save sha256sum
-# arg1 FS to generate sha256
-# arg2 File name to save the sha256 output
-_save_checksum()
-{
-       local i=0
-       >$2
-       cd $1
-       for i in `find . -type f`; do sha256sum $i >> $2; done
-       cd $OLDPWD
-}
-
-# Verify the sha256sum for a FS
-# arg1 FS to be tested
-# arg2 sha256 file
-_verify_checksum()
-{
-       cd $1
-       [ -f $2 ] || _fail "checksum file $2 not found"
-       sha256sum -c $2 | grep "FAILED"
-       cd $OLDPWD
-}
-
-# Create a snapshot
-# arg1 dest dir
-# Return snapshot name in the SNAPNAME
-_create_snap()
-{
-       local x
-       [ -d $1 ] || _fail "Destination dir $1 not present"
-       SNAPNAME=`mktemp -u $SCRATCH_MNT/snap.XXXXXX`
-       btrfs subvolume snapshot $1 $SNAPNAME > /dev/null || _fail "snapshot create failed"
-}
-
-# Reads and writes new data but does not allocate new blocks
-# arg1 FS to be modified
-_read_modify_write()
-{
-       local i
-       local FSIZE
-       for i in `find $1 -type f`
-       do
-               FSIZE=`stat -t $i | cut -d" " -f2`
-               dd if=$i of=/dev/null obs=$FSIZE count=1 status=noxfer 2>/dev/null &
-               dd if=/dev/urandom of=$i obs=$FSIZE count=1 status=noxfer 2>/dev/null &
-       done
-       wait $!
-}
-
-# Fills the allocated blocks
-# arg1 FS in question
-_fill_blk()
-{
-       local FSIZE
-       local BLKS
-       local NBLK
-       local FALLOC
-       local WS
-
-       for i in `find /$1 -type f`
-       do
-               FSIZE=`stat -t $i | cut -d" " -f2`
-               BLKS=`stat -c "%B" $i`
-               NBLK=`stat -c "%b" $i`
-               FALLOC=$(($BLKS * $NBLK))
-               WS=$(($FALLOC - $FSIZE))
-               dd if=/dev/urandom of=$i oseek=$FSIZE obs=$WS count=1 status=noxfer 2>/dev/null &
-       done
-       wait $!
-}
-
-
-# Append a random size to the files
-# arg1 : FS in question
-_append_file()
-{
-       local FSIZE
-       local X
-       local N
-       local i
-       N=0
-       for i in `find $1 -type f`
-       do
-               if [ $N == 0 ]; then
-                       X=$i
-                       FSIZE=`stat -t $X | cut -d" " -f2`
-                       dd if=$X of=$X seek=1 bs=$FSIZE obs=$FSIZE count=1 status=noxfer 2>/dev/null &
-                       N=$(($N+1))
-                       continue
-               fi
-               FSIZE=`stat -t $i | cut -d" " -f2`
-               dd if=$X of=$i seek=1 bs=$FSIZE obs=$FSIZE count=1 status=noxfer 2>/dev/null &
-               X=$i
-       done
-       wait $!
-}
-
-##################### real QA test starts here###################################
-# sv1 - is just a name nothing spl
-firstvol="$SCRATCH_MNT/sv1"
-btrfs subvolume create $firstvol > /dev/null || _fail "btrfs subvolume create $firstvol failed"
-dirp=`mktemp -duq $firstvol/dir.XXXXXX`
-_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10 -x
-SNAPNAME=0
-_create_snap $firstvol
-_save_checksum $firstvol $tmp.sv1.sum
-_verify_checksum $SNAPNAME $tmp.sv1.sum
-
-#Append1 the files
-_fill_blk $SNAPNAME
-_verify_checksum $firstvol $tmp.sv1.sum
-
-#Append2 the files
-_append_file $SNAPNAME
-_verify_checksum $firstvol $tmp.sv1.sum
-
-#read modify write
-_read_modify_write $SNAPNAME
-_verify_checksum $firstvol $tmp.sv1.sum
-
-#nested snapshot test
-src_vol=$firstvol
-for i in `seq 1 7`; do
-       SNAPNAME=0
-       _create_snap $src_vol
-       _verify_checksum $SNAPNAME $tmp.sv1.sum
-       src_vol=$SNAPNAME
-done
-
-# file delete test
-SNAPNAME=0
-_create_snap $firstvol
-tname=`echo $SNAPNAME | rev | cut -d"/" -f1 | rev`
-_save_checksum $SNAPNAME $tmp.$tname.sum
-\rm -rf $firstvol/*
-_verify_checksum $SNAPNAME $tmp.$tname.sum
-
-umount $SCRATCH_DEV || _fail "unmount failed"
-
-echo "Silence is golden"
-status=0; exit
diff --git a/264.out b/264.out
deleted file mode 100644 (file)
index eca790b..0000000
--- a/264.out
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 264
-Silence is golden
diff --git a/265 b/265
deleted file mode 100755 (executable)
index f28d4e5..0000000
--- a/265
+++ /dev/null
@@ -1,185 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 265
-#
-# btrfs vol tests
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2011 Oracle.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-dev_removed=0
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-    if [ $dev_removed == 1 ]; then
-        umount $SCRATCH_MNT
-        _devmgt_add "${DEVHTL}"
-    fi
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-_need_to_be_root
-_supported_fs btrfs
-_supported_os Linux
-_require_scratch
-_require_scratch_dev_pool
-_require_deletable_scratch_dev_pool
-
-# Test cases related to raid in btrfs
-_test_raid0()
-{
-       export MKFS_OPTIONS="-m raid0 -d raid0"
-       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-       umount $SCRATCH_MNT
-}
-
-_test_raid1()
-{
-       export MKFS_OPTIONS="-m raid1 -d raid1"
-       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-       umount $SCRATCH_MNT
-}
-
-_test_raid10()
-{
-       export MKFS_OPTIONS="-m raid10 -d raid10"
-       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-       umount $SCRATCH_MNT
-}
-
-_test_single()
-{
-       export MKFS_OPTIONS="-m single -d single"
-       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-       umount $SCRATCH_MNT
-}
-
-_test_add()
-{
-       local i
-       local devs[]="( $SCRATCH_DEV_POOL )"
-       local n=${#devs[@]}
-
-       n=$(($n-1))
-
-       export MKFS_OPTIONS=""
-       _scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-       for i in `seq 1 $n`; do
-               btrfs device add ${devs[$i]} $SCRATCH_MNT > /dev/null 2>&1 || _fail "device add failed"
-       done
-       btrfs filesystem balance $SCRATCH_MNT || _fail "balance failed"
-       umount $SCRATCH_MNT
-}
-
-_test_replace()
-{
-       local i
-       local devs=( $SCRATCH_DEV_POOL )
-       local n=${#devs[@]}
-       local ds
-       local d
-       local DEVHTL=""
-
-       # exclude the last disk in the disk pool
-       n=$(($n-1))
-       ds=${devs[@]:0:$n}
-
-       export MKFS_OPTIONS="-m raid1 -d raid1"
-       _scratch_mkfs "$ds" > /dev/null 2>&1 || _fail "tr: mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-
-       #pick the 2nd last disk 
-       ds=${devs[@]:$(($n-1)):1}
-
-       # retrive the HTL for this scsi disk
-       d=`echo $ds|cut -d"/" -f3`
-       DEVHTL=`ls -l /sys/class/block/${d} | rev | cut -d "/" -f 3 | rev`
-
-       #fail disk
-       _devmgt_remove ${DEVHTL}
-       dev_removed=1
-
-       btrfs fi show $SCRATCH_DEV | grep "Some devices missing" > /dev/null || _fail \
-                                                       "btrfs did not report device missing"
-
-       # add a new disk to btrfs
-       ds=${devs[@]:$(($n)):1}
-       btrfs device add ${ds} $SCRATCH_MNT > /dev/null 2>&1 || _fail "dev add failed"
-       # in some system balance fails if there is no delay (a bug)
-       # putting sleep 10 to work around as of now
-       # sleep 10
-       btrfs fi balance $SCRATCH_MNT || _fail "dev balance failed"
-
-       # cleaup. add the removed disk
-       umount $SCRATCH_MNT
-       _devmgt_add "${DEVHTL}"
-       dev_removed=0
-}
-
-_test_remove()
-{
-       _scratch_mkfs "$SCRATCH_DEV_POOL" > /dev/null 2>&1 || _fail "mkfs failed"
-       _scratch_mount
-       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
-       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
-
-       # pick last dev in the list
-       dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
-       btrfs device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
-       btrfs fi show $SCRATCH_DEV 2>&1 | grep $dev_del > /dev/null && _fail "btrfs still shows the deleted dev"
-       umount $SCRATCH_MNT
-}
-
-_test_raid0
-_test_raid1
-_test_raid10
-_test_single
-_test_add
-_test_replace
-_test_remove
-
-echo "Silence is golden"
-status=0; exit
diff --git a/265.out b/265.out
deleted file mode 100644 (file)
index 9fa4eb0..0000000
--- a/265.out
+++ /dev/null
@@ -1,2 +0,0 @@
-QA output created by 265
-Silence is golden
diff --git a/271 b/271
deleted file mode 100755 (executable)
index 50b4c0b..0000000
--- a/271
+++ /dev/null
@@ -1,66 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 271
-#
-# Regression testcase for d583fb87a3ff0 (ext4 extent corruption)
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-_supported_fs ext4
-_supported_os Linux
-_need_to_be_root
-_require_scratch
-
-_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seq.full 2>&1
-
-# -onoload and EXT4_SYNC_FL on file is important becase result in
-# metadata sync writes inside ext4_handle_dirty_metadata()
-_scratch_mount -onoload
-touch $SCRATCH_MNT/file
-chattr +S $SCRATCH_MNT/file
-# Create sparse file 
-for ((i = 0; i < 21; i++))
-do
-    dd if=/dev/zero of=$SCRATCH_MNT/file bs=4k count=1 seek=$((i*10))
-done
-# truncate last extent
-$XFS_IO_PROG -F -f -c "truncate $((4096*200))" $SCRATCH_MNT/file
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-echo "Check filesystem"
-_check_scratch_fs
-status=$?
-exit
diff --git a/271.out b/271.out
deleted file mode 100644 (file)
index 22a3c50..0000000
--- a/271.out
+++ /dev/null
@@ -1,44 +0,0 @@
-QA output created by 271
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-1+0 records in
-1+0 records out
-Check filesystem
diff --git a/272 b/272
deleted file mode 100755 (executable)
index 9a2a06b..0000000
--- a/272
+++ /dev/null
@@ -1,107 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 272
-#
-# Test data journaling flag switch for a single file  
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# ext3 doesn't support direct IO in journalling mode
-write_opt_list="iflag=noatime conv=notrunc conv=fsync"
-# For filesystems that can handle it, add also direct IO test
-[ $FSTYP = "ext4" ] && write_opt_list="$write_opt_list oflag=direct"
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-_workout()
-{
-       echo "Switch data journalling mode. Silence is golden."
-       chattr_opt_list="+j -j +jS -j"
-       idx=0
-       #
-       for write_opt in $write_opt_list
-       do
-               idx=$((idx + 1))
-               for chattr_opt in $chattr_opt_list
-               do
-                   
-                       echo "OP write_opt: $write_opt 4M, \
-chattr_opt: $chattr_opt" >>$seq.full
-                       dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
-                               bs=1M count=4 $write_opt \
-                               >> $seq.full 2>&1 || exit
-                       chattr $chattr_opt $SCRATCH_MNT/file.$idx >> $seq.full \
-                               || exit
-               done
-       done
-       sync
-       # Same as previous test, but for one file,
-       # and with ENOSPC triggering
-       for write_opt in $write_opt_list
-       do
-               idx=$((idx + 1))
-               for chattr_opt in $chattr_opt_list
-               do
-
-                       echo "OP write_opt: $write_opt ENOSPC, \
-chattr_opt: $chattr_opt" >>$seq.full
-                       dd if=/dev/zero of=$SCRATCH_MNT/file.$idx \
-                               bs=1M $write_opt >> $seq.full 2>&1
-                       chattr $chattr_opt $SCRATCH_MNT/file.$idx \
-                               >> $seq.full || exit
-               done
-               sync
-               unlink $SCRATCH_MNT/file.$idx
-       done
-}
-
-# real QA test starts here
-_supported_fs ext3 ext4
-_supported_os Linux
-_need_to_be_root
-_require_scratch
-
-_scratch_mkfs_sized $((64 * 1024 * 1024)) >> $seq.full 2>&1
-_scratch_mount
-
-if ! _workout; then
-       echo "workout failed"
-       _scratch_unmount
-       status=1
-       exit
-fi
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-echo "Check filesystem"
-_check_scratch_fs
-status=$?
-exit
diff --git a/272.out b/272.out
deleted file mode 100644 (file)
index a9eaf84..0000000
--- a/272.out
+++ /dev/null
@@ -1,3 +0,0 @@
-QA output created by 272
-Switch data journalling mode. Silence is golden.
-Check filesystem
diff --git a/276 b/276
deleted file mode 100755 (executable)
index 07d288c..0000000
--- a/276
+++ /dev/null
@@ -1,269 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 276
-#
-# Run fsstress to create a reasonably strange file system, make a
-# snapshot and run more fsstress. Then select some files from that fs,
-# run filefrag to get the extent mapping and follow the backrefs.
-# We check to end up back at the original file with the correct offset.
-#
-#-----------------------------------------------------------------------
-# Copyright (C) 2011 STRATO.  All rights reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1
-noise_pid=0
-
-_cleanup()
-{
-       if [ $noise_pid -ne 0 ]; then
-               echo "background noise kill $noise_pid" >>$seq.full
-               kill $noise_pid
-               noise_pid=0
-               wait
-       fi
-       echo "*** unmount"
-       umount $SCRATCH_MNT 2>/dev/null
-       rm -f $tmp.*
-}
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-_need_to_be_root
-_supported_fs btrfs
-_supported_os Linux
-_require_scratch
-_require_no_large_scratch_dev
-_require_btrfs inspect-internal
-_require_command "/usr/sbin/filefrag"
-
-rm -f $seq.full
-
-FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
-'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
-'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
-'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
-'$length * $blocksize, "#", $logical * $blocksize, " "'
-
-# this makes filefrag output script readable by using a perl helper.
-# output is one extent per line, with three numbers separated by '#'
-# the numbers are: physical, length, logical (all in bytes)
-# sample output: "1234#10#5678" -> physical 1234, length 10, logical 5678
-_filter_extents()
-{
-       tee -a $seq.full | $PERL_PROG -ne "$FILEFRAG_FILTER"
-}
-
-_check_file_extents()
-{
-       cmd="filefrag -v $1"
-       echo "# $cmd" >> $seq.full
-       out=`$cmd | _filter_extents`
-       if [ -z "$out" ]; then
-               return 1
-       fi
-       echo "after filter: $out" >> $seq.full
-       echo $out
-       return 0
-}
-
-# use a logical address and walk the backrefs back to the inode.
-# compare to the expected result.
-# returns 0 on success, 1 on error (with output made)
-_btrfs_inspect_addr()
-{
-       mp=$1
-       addr=$2
-       expect_addr=$3
-       expect_inum=$4
-       file=$5
-       cmd="$BTRFS_UTIL_PROG inspect-internal logical-resolve -P $addr $mp"
-       echo "# $cmd" >> $seq.full
-       out=`$cmd`
-       echo "$out" >> $seq.full
-       grep_expr="inode $expect_inum offset $expect_addr root"
-       echo "$out" | grep "^$grep_expr 5$" >/dev/null
-       ret=$?
-       if [ $ret -eq 0 ]; then
-               # look for a root number that is not 5
-               echo "$out" | grep "^$grep_expr \([0-46-9][0-9]*\|5[0-9]\+\)$" \
-                       >/dev/null
-               ret=$?
-       fi
-       if [ $ret -eq 0 ]; then
-               return 0
-       fi
-       echo "unexpected output from"
-       echo "  $cmd"
-       echo "expected inum: $expect_inum, expected address: $expect_addr,"\
-               "file: $file, got:"
-       echo "$out"
-       return 1
-}
-
-# use an inode number and walk the backrefs back to the file name.
-# compare to the expected result.
-# returns 0 on success, 1 on error (with output made)
-_btrfs_inspect_inum()
-{
-       file=$1
-       inum=$2
-       snap_name=$3
-       mp="$SCRATCH_MNT/$snap_name"
-       cmd="$BTRFS_UTIL_PROG inspect-internal inode-resolve $inum $mp"
-       echo "# $cmd" >> $seq.full
-       out=`$cmd`
-       echo "$out" >> $seq.full
-       grep_expr="^$file$"
-       cnt=`echo "$out" | grep "$grep_expr" | wc -l`
-       if [ $cnt -ge "1" ]; then
-               return 0
-       fi
-       echo "unexpected output from"
-       echo "  $cmd"
-       echo "expected path: $file, got:"
-       echo "$out"
-       return 1
-}
-
-_btrfs_inspect_check()
-{
-       file=$1
-       physical=$2
-       length=$3
-       logical=$4
-       snap_name=$5
-       cmd="stat -c %i $file"
-       echo "# $cmd" >> $seq.full
-       inum=`$cmd`
-       echo "$inum" >> $seq.full
-       _btrfs_inspect_addr $SCRATCH_MNT $physical $logical $inum $file
-       ret=$?
-       if [ $ret -eq 0 ]; then
-               _btrfs_inspect_inum $file $inum $snap_name
-               ret=$?
-       fi
-       return $ret
-}
-
-workout()
-{
-       fsz=$1
-       nfiles=$2
-       procs=$3
-       snap_name=$4
-       do_bg_noise=$5
-
-       umount $SCRATCH_DEV >/dev/null 2>&1
-       echo "*** mkfs -dsize=$fsz"    >>$seq.full
-       echo ""                                     >>$seq.full
-       _scratch_mkfs_sized $fsz >>$seq.full 2>&1 \
-               || _fail "size=$fsz mkfs failed"
-       run_check _scratch_mount
-       # -w ensures that the only ops are ones which cause write I/O
-       run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \
-               $FSSTRESS_AVOID
-
-       run_check $BTRFS_UTIL_PROG subvol snap $SCRATCH_MNT \
-               $SCRATCH_MNT/$snap_name
-
-       run_check umount $SCRATCH_DEV >/dev/null 2>&1
-       run_check _scratch_mount "-o compress=lzo"
-
-       # make some noise but ensure we're not touching existing data
-       # extents.
-       run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n 4000 \
-               -z -f chown=3 -f link=1 -f mkdir=2 -f mknod=2 \
-               -f rename=2 -f setxattr=1 -f symlink=2
-
-       clean_dir="$SCRATCH_MNT/next"
-       mkdir $clean_dir
-       # now make more files to get a higher tree
-       run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
-               $FSSTRESS_AVOID
-       run_check umount $SCRATCH_DEV >/dev/null 2>&1
-       run_check _scratch_mount "-o atime"
-
-       if [ $do_bg_noise -ne 0 ]; then
-               # make background noise while backrefs are being walked
-               while /bin/true; do
-                       echo background fsstress >>$seq.full
-                       run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999
-                       echo background rm >>$seq.full
-                       rm -rf $SCRATCH_MNT/bgnoise/
-               done &
-               noise_pid=`jobs -p %1`
-               echo "background noise by $noise_pid" >>$seq.full
-       fi
-
-       cnt=0
-       errcnt=0
-       dir="$SCRATCH_MNT/$snap_name/"
-       for file in `find $dir -name f\* -size +0 | sort -R`; do
-               extents=`_check_file_extents $file`
-               ret=$?
-               if [ $ret -ne 0 ]; then
-                       continue;
-               fi
-               for i in $extents; do
-                       physical=$i
-                       length=$i
-                       logical=$i
-                       physical=`echo $physical | sed -e 's/#.*//'`
-                       length=`echo $length | sed -e 's/[^#]+#//'`
-                       length=`echo $length | sed -e 's/#.*//'`
-                       logical=`echo $logical | sed -e 's/.*#//'`
-                       _btrfs_inspect_check $file $physical $length $logical \
-                                               $snap_name
-                       ret=$?
-                       if [ $ret -ne 0 ]; then
-                               errcnt=`expr $errcnt + 1`
-                       fi
-               done
-               cnt=`expr $cnt + 1`
-               if [ $cnt -ge $nfiles ]; then
-                       break
-               fi
-       done
-
-       if [ $errcnt -gt 0 ]; then
-               _fail "test failed: $errcnt error(s)"
-       fi
-}
-
-echo "*** test backref walking"
-
-snap_name="snap1"
-filesize=`expr 2000 \* 1024 \* 1024`
-nfiles=4
-numprocs=1
-do_bg_noise=1
-
-workout $filesize $nfiles $numprocs $snap_name $do_bg_noise
-
-echo "*** done"
-status=0
-exit
diff --git a/276.out b/276.out
deleted file mode 100644 (file)
index 2032dea..0000000
--- a/276.out
+++ /dev/null
@@ -1,4 +0,0 @@
-QA output created by 276
-*** test backref walking
-*** done
-*** unmount
diff --git a/284 b/284
deleted file mode 100644 (file)
index b86ef32..0000000
--- a/284
+++ /dev/null
@@ -1,170 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 284
-#
-# Btrfs Online defragmentation tests
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2012 Fujitsu Liu Bo.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-here="`pwd`"
-tmp=/tmp/$$
-cnt=11999
-filesize=48000
-
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-}
-
-_create_file()
-{
-       if [ $1 -ne 2 ]; then
-               tmpfile="$SCRATCH_MNT/tmp_file"
-       else
-               mkdir -p $SCRATCH_MNT/tmp_dir
-               tmpfile="$SCRATCH_MNT/tmp_dir/tmp_file"
-       fi
-               
-       for i in `seq $cnt -1 0`; do
-               dd if=/dev/zero of=$tmpfile bs=4k count=1 \
-                conv=notrunc seek=$i oflag=sync &>/dev/null
-       done
-       # get md5sum
-       md5sum $tmpfile > /tmp/checksum
-}
-
-_btrfs_online_defrag()
-{
-       str=""
-       if [ "$2" = "2" ];then
-               str="$str -s -1 -l $((filesize / 2)) "
-       elif [ "$2" = "3" ];then
-               str="$str -s $((filesize + 1)) -l $((filesize / 2)) "
-               HAVE_DEFRAG=1
-       elif [ "$2" = "4" ];then
-               str="$str -l -1 "
-       elif [ "$2" = "5" ];then
-               str="$str -l $((filesize + 1)) "
-       elif [ "$2" = "6" ];then
-               str="$str -l $((filesize / 2)) "
-       fi
-
-       if [ "$3" = "2" ];then
-               str="$str -c "
-       fi
-
-       if [ "$str" != "" ]; then
-               btrfs filesystem defragment $str $SCRATCH_MNT/tmp_file
-       else
-               if [ "$1" = "1" ];then
-                       btrfs filesystem defragment $SCRATCH_MNT/tmp_file
-               elif [ "$1" = "2" ];then
-                       btrfs filesystem defragment $SCRATCH_MNT/tmp_dir
-               elif [ "$1" = "3" ];then
-                       btrfs filesystem defragment $SCRATCH_MNT
-               fi
-       fi
-       ret_val=$?
-       _scratch_remount
-       if [ $ret_val -ne 20 ];then
-               echo "btrfs filesystem defragment failed! err is $ret_val"
-       fi
-}
-
-_checksum()
-{
-       md5sum -c /tmp/checksum > /dev/null 2>&1
-       if [ $? -ne 0 ]; then
-               echo "md5 checksum failed!"
-       fi
-}
-
-_cleanup_defrag()
-{
-       umount $SCRATCH_MNT > /dev/null 2>&1
-}
-
-_setup_defrag()
-{
-       umount $SCRATCH_MNT > /dev/null 2>&1
-       _scratch_mkfs > /dev/null 2>&1
-       _scratch_mount
-       _create_file $1
-}
-
-_rundefrag()
-{
-       _setup_defrag $1
-       _btrfs_online_defrag $1 $2 $3
-       _checksum
-       _cleanup_defrag
-       _check_scratch_fs
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.defrag
-
-# real QA test starts here
-_supported_fs btrfs
-_supported_os Linux
-
-_setup_testdir
-## We require scratch so that we'll have free contiguous space
-_require_scratch
-_scratch_mkfs >/dev/null 2>&1
-_scratch_mount
-_require_defrag
-
-echo "defrag object | defragment range | defragment compress"
-echo "a single file |  default | off"
-_rundefrag 1 1 1
-
-echo "a single file | default |  on"
-_rundefrag 1 1 2
-
-echo "a single file | start < 0 && 0 < len < file size | off"
-_rundefrag 1 2 1
-
-echo "a single file | start > file size && 0 < len < file size | off"
-_rundefrag 1 3 1
-
-echo "a single file | start = 0 && len < 0 | off"
-_rundefrag 1 4 1
-
-echo "a single file | start = 0 && len > file size | off"
-_rundefrag 1 5 1
-
-echo "a single file | start = 0 && 0 < len < file size | off"
-_rundefrag 1 6 1
-
-echo "a directory | default | off"
-_rundefrag 2 1 1
-
-echo "a filesystem | default | off"
-_rundefrag 3 1 1
-
-status=0
-exit
diff --git a/284.out b/284.out
deleted file mode 100644 (file)
index 4a69f82..0000000
--- a/284.out
+++ /dev/null
@@ -1,11 +0,0 @@
-QA output created by 284
-defrag object | defragment range | defragment compress
-a single file |  default | off
-a single file | default |  on
-a single file | start < 0 && 0 < len < file size | off
-a single file | start > file size && 0 < len < file size | off
-a single file | start = 0 && len < 0 | off
-a single file | start = 0 && len > file size | off
-a single file | start = 0 && 0 < len < file size | off
-a directory | default | off
-a filesystem | default | off
diff --git a/289 b/289
deleted file mode 100755 (executable)
index 1a7cff5..0000000
--- a/289
+++ /dev/null
@@ -1,109 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 289
-#
-# Test overhead & df output for extN filesystems
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2012 Red Hat, Inc.  All Rights Reserved.
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-# real QA test starts here
-
-# Modify as appropriate.
-_supported_fs ext2 ext3 ext4
-_supported_os Linux
-_require_scratch
-
-rm -f $seq.full
-
-_scratch_mkfs >> $seq.full 2>&1
-
-# Get the honest truth about block counts straight from metadata on disk
-TOTAL_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
-               | awk '/Block count:/{print $3}'`
-
-FREE_BLOCKS=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
-               | awk '/Free blocks:/{print $3}'`
-
-# ext3 doesn't count journal blocks as overhead, ext4 does.
-if [ $FSTYP = "ext3" ]; then
-       JOURNAL_SIZE=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
-               | awk '/Journal size:/{print $3}' | _filter_size_to_bytes`
-       BLOCK_SIZE=`dumpe2fs -h $SCRATCH_DEV 2>/dev/null \
-               | awk '/Block size:/{print $3}'`
-       JOURNAL_BLOCKS=$(($JOURNAL_SIZE/$BLOCK_SIZE))
-else
-       JOURNAL_BLOCKS=0
-fi
-
-OVERHEAD=$(($TOTAL_BLOCKS-$FREE_BLOCKS-$JOURNAL_BLOCKS))
-
-#  bsddf|minixdf
-#         Set the behaviour  for  the  statfs  system  call.  The  minixdf
-#         behaviour is to return in the f_blocks field the total number of
-#         blocks of the filesystem, while the bsddf  behaviour  (which  is
-#         the default) is to subtract the overhead blocks used by the ext2
-#         filesystem and not available for file storage.
-
-# stat -f output looks like this; we get f_blocks from that, which
-# varies depending on the df mount options used below:
-
-#   File: "/mnt/test"
-#    ID: affc5f2b2f57652 Namelen: 255     Type: ext2/ext3
-# Block size: 4096       Fundamental block size: 4096
-# Blocks: Total: 5162741    Free: 5118725    Available: 4856465
-# Inodes: Total: 1313760    Free: 1313749
-
-_scratch_mount "-o minixdf"
-MINIX_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
-umount $SCRATCH_MNT
-
-_scratch_mount "-o bsddf"
-BSD_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
-umount $SCRATCH_MNT
-
-# Echo data to $seq.full for analysis
-echo "Overhead is $OVERHEAD blocks out of $TOTAL_BLOCKS ($FREE_BLOCKS free)" >> $seq.full
-echo "MINIX free blocks $MINIX_F_BLOCKS" >> $seq.full
-echo "BSD free blocks $BSD_F_BLOCKS" >> $seq.full
-
-# minix should be exactly equal (hence tolerance of 0)
-_within_tolerance "minix f_blocks" $MINIX_F_BLOCKS $TOTAL_BLOCKS 0 -v
-# bsd should be within ... we'll say 1% for some slop
-_within_tolerance "bsd f_blocks" $BSD_F_BLOCKS $(($TOTAL_BLOCKS-$OVERHEAD)) 1% -v
-
-# success, all done
-status=0
-exit
diff --git a/289.out b/289.out
deleted file mode 100644 (file)
index a4de760..0000000
--- a/289.out
+++ /dev/null
@@ -1,3 +0,0 @@
-QA output created by 289
-minix f_blocks is in range
-bsd f_blocks is in range
diff --git a/298 b/298
deleted file mode 100644 (file)
index 5d789a0..0000000
--- a/298
+++ /dev/null
@@ -1,188 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 298
-#
-# Test that filesystem sends discard requests only on free blocks
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2013 Red Hat, Inc., Tomas Racek <tracek@redhat.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`
-echo "QA output created by $seq"
-
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-. common.config
-. common.rc
-
-_supported_fs ext4 xfs
-_supported_os Linux
-_require_fstrim
-_require_fs_space $TEST_DIR 307200
-[ "$FSTYP" = "ext4" ] && _require_dumpe2fs
-
-_cleanup()
-{
-       $UMOUNT_PROG $loop_dev &> /dev/null
-       _destroy_loop_device $loop_dev
-       if [ $status -eq 0 ]; then
-               rm -rf $tmp
-               rm $img_file
-       fi
-}
-
-get_holes()
-{
-       $XFS_IO_PROG -c fiemap $1 | grep hole | $SED_PROG 's/.*\[\(.*\)\.\.\(.*\)\].*/\1 \2/'
-}
-
-get_free_sectors()
-{
-       case $FSTYP in
-       ext4)
-       $DUMPE2FS_PROG $img_file  2>&1 | grep " Free blocks" | cut -d ":" -f2- | \
-               tr ',' '\n' | $SED_PROG 's/^ //' | \
-               $AWK_PROG -v spb=$sectors_per_block 'BEGIN{FS="-"};
-                    NF {
-                       if($2 != "") # range of blocks
-                               print spb * $1, spb * ($2 + 1) - 1;
-                       else            # just single block
-                               print spb * $1, spb * ($1 + 1) - 1;
-                    }'
-       ;;
-       xfs)
-       agsize=`xfs_info $loop_mnt | $SED_PROG -n 's/.*agsize=\(.*\) blks.*/\1/p'`
-       # Convert free space (agno, block, length) to (start sector, end sector)
-       $UMOUNT_PROG $loop_mnt
-       $XFS_DB_PROG -c "freesp -d" $img_file | $SED_PROG '/^.*from/,$d'| \
-                $AWK_PROG -v spb=$sectors_per_block -v agsize=$agsize \
-               '{ print spb * ($1 * agsize + $2), spb * ($1 * agsize + $2 + $3) - 1 }'
-       ;;
-       esac
-}
-
-merge_ranges()
-{
-       # Merges consecutive ranges from two input files
-       file1=$1
-       file2=$2
-
-       tmp_file=$tmp/sectors.tmp
-
-       cat $file1 $file2 | sort -n > $tmp_file
-
-       read line < $tmp_file
-       start=${line% *}
-       end=${line#* }
-
-       # Continue from second line
-       sed -i "1d" $tmp_file
-       while read line; do
-               curr_start=${line% *}
-               curr_end=${line#* }
-
-               if [ `expr $end + 1` -ge $curr_start ]; then
-                       if [ $curr_end -gt $end ]; then
-                               end=$curr_end
-                       fi
-               else
-                       echo $start $end
-                       start=$curr_start
-                       end=$curr_end
-               fi
-       done < $tmp_file
-
-       # Print last line
-       echo $start $end
-
-       rm $tmp_file
-}
-
-here=`pwd`
-tmp=`mktemp -d`
-
-img_file=$TEST_DIR/$$.fs
-dd if=/dev/zero of=$img_file bs=1M count=300 &> /dev/null
-
-loop_dev=$(_create_loop_device $img_file)
-loop_mnt=$tmp/loop_mnt
-
-fiemap_ref="$tmp/reference"
-fiemap_after="$tmp/after"
-free_sectors="$tmp/free_sectors"
-merged_sectors="$tmp/merged_free_sectors"
-
-mkdir $loop_mnt
-
-[ "$FSTYP" = "xfs" ] && MKFS_OPTIONS="-f $MKFS_OPTIONS"
-
-$MKFS_PROG -t $FSTYP $MKFS_OPTIONS $loop_dev &> /dev/null
-$MOUNT_PROG $loop_dev $loop_mnt
-
-echo -n "Generating garbage on loop..."
-for i in `seq 1 10`; do
-       mkdir $loop_mnt/$i
-       cp -r $here/* $loop_mnt/$i
-done
-
-# Get reference fiemap, this can contain i.e. uninitialized inode table
-sync
-get_holes $img_file > $fiemap_ref
-
-# Delete some files
-find $loop_mnt -type f -print | $AWK_PROG \
-       'BEGIN {srand()}; {if(rand() > 0.7) print $1;}' | xargs rm
-echo "done."
-
-echo -n "Running fstrim..."
-$FSTRIM_PROG $loop_mnt &> /dev/null
-echo "done."
-
-echo -n "Detecting interesting holes in image..."
-# Get after-trim fiemap
-sync
-get_holes $img_file > $fiemap_after
-echo "done."
-
-echo -n "Comparing holes to the reported space from FS..."
-# Get block size
-block_size=$(stat -f -c "%S" $loop_mnt/)
-sectors_per_block=`expr $block_size / 512`
-
-# Obtain free space from filesystem
-get_free_sectors > $free_sectors
-# Merge original holes with free sectors
-merge_ranges $fiemap_ref $free_sectors > $merged_sectors
-
-# Check that all holes after fstrim call were already present before or
-# that they match free space reported from FS
-while read line; do
-        from=${line% *}
-        to=${line#* }
-       if ! $AWK_PROG -v s=$from -v e=$to \
-               '{ if ($1 <= s && e <= $2) found = 1};
-               END { if(found) exit 0; else exit 1}' $merged_sectors
-       then
-               echo "Sectors $from-$to are not marked as free!"
-               exit
-       fi
-done < $fiemap_after
-echo "done."
-
-status=0
-exit
diff --git a/298.out b/298.out
deleted file mode 100644 (file)
index 32820bd..0000000
--- a/298.out
+++ /dev/null
@@ -1,5 +0,0 @@
-QA output created by 298
-Generating garbage on loop...done.
-Running fstrim...done.
-Detecting interesting holes in image...done.
-Comparing holes to the reported space from FS...done.
diff --git a/301 b/301
deleted file mode 100644 (file)
index dc19c3a..0000000
--- a/301
+++ /dev/null
@@ -1,124 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 301
-#
-# Ext4 defragmentation stress test
-# Defragment file while other task does direct io
-#-----------------------------------------------------------------------
-# (c) 2013 Dmitry Monakhov
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.defrag
-
-# real QA test starts here
-_supported_os Linux
-_supported_fs ext4
-_need_to_be_root
-_require_scratch
-_require_defrag
-
-NUM_JOBS=$((4*LOAD_FACTOR))
-BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
-# We need space for 2 files (test file, and donor one)
-# reserve 30% in order to avoid ENOSPC
-FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
-
-cat >$tmp-$seq.fio <<EOF
-# Common e4defrag regression tests
-[global]
-ioengine=ioe_e4defrag
-iodepth=1
-directory=${SCRATCH_MNT}
-filesize=${FILE_SIZE}
-size=999G
-buffered=0
-fadvise_hint=0
-group_reporting
-
-#################################
-# Test1
-# Defragment file while other task does direct io
-
-# Continious sequential defrag activity
-[defrag-4k]
-ioengine=e4defrag
-iodepth=1
-bs=128k
-donorname=test1.def
-filename=test1
-inplace=0
-rw=write
-numjobs=${NUM_JOBS}
-runtime=30*${TIME_FACTOR}
-time_based
-
-# Verifier
-[aio-dio-verifier]
-ioengine=libaio
-iodepth=128*${LOAD_FACTOR}
-numjobs=1
-verify=crc32c-intel
-verify_fatal=1
-verify_dump=1
-verify_backlog=1024
-verify_async=1
-verifysort=1
-direct=1
-bs=64k
-rw=randwrite
-filename=test1
-runtime=30*${TIME_FACTOR}
-time_based
-EOF
-
-_workout()
-{
-       echo ""
-       echo " Start defragment activity"
-       echo ""
-       cat $tmp-$seq.fio >>  $seq.full
-       run_check $FIO_PROG $tmp-$seq.fio
-}
-
-_require_fio $tmp-$seq.fio
-
-_scratch_mkfs  >> $seq.full 2>&1
-_scratch_mount
-
-if ! _workout; then
-       umount $SCRATCH_DEV 2>/dev/null
-       exit
-fi
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-_check_scratch_fs
-status=$?
diff --git a/301.out b/301.out
deleted file mode 100644 (file)
index 044a685..0000000
--- a/301.out
+++ /dev/null
@@ -1,4 +0,0 @@
-QA output created by 301
-
- Start defragment activity
-
diff --git a/302 b/302
deleted file mode 100644 (file)
index 43a9517..0000000
--- a/302
+++ /dev/null
@@ -1,141 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 302
-#
-# Ext4 defragmentation stress test
-# Perform defragmentation on file under buffered io
-# while third task does direct io to donor file
-#-----------------------------------------------------------------------
-# (c) 2013 Dmitry Monakhov
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.defrag
-
-# real QA test starts here
-_supported_os Linux
-_supported_fs ext4
-_need_to_be_root
-_require_scratch
-_require_defrag
-
-BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
-# We need space for 2 files (test file, and donor one)
-# reserve 30% in order to avoid ENOSPC
-FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
-
-cat >$tmp-$seq.fio <<EOF
-# Common e4defrag regression tests
-[global]
-ioengine=ioe_e4defrag
-iodepth=1
-directory=${SCRATCH_MNT}
-filesize=${FILE_SIZE}
-size=999G
-buffered=0
-fadvise_hint=0
-group_reporting
-
-##########################################
-# Test2
-# Perform defragmentation on file under buffered io
-# while third task does direct io to donor file
-#
-# Continuous sequential defrag activity
-[defrag-4k]
-stonewall
-ioengine=e4defrag
-iodepth=1
-bs=128k
-donorname=test2.def
-filename=test2
-inplace=0
-rw=write
-numjobs=${LOAD_FACTOR}
-runtime=30*${TIME_FACTOR}
-time_based
-
-# Run DIO/AIO for donor file
-[donor-file-fuzzer]
-ioengine=libaio
-iodepth=128*${LOAD_FACTOR}
-numjobs=${LOAD_FACTOR}
-verify=0
-direct=1
-bs=64k
-rw=randwrite
-filename=test2.def
-runtime=30*${TIME_FACTOR}
-time_based
-
-# Verifier thread
-[aio-dio-verifier]
-ioengine=libaio
-iodepth=128*${LOAD_FACTOR}
-numjobs=1
-verify=crc32c-intel
-verify_fatal=1
-verify_dump=1
-verify_backlog=1024
-verify_async=1
-verifysort=1
-buffered=1
-bs=64k
-rw=randrw
-filename=test2
-runtime=30*${TIME_FACTOR}
-time_based
-
-EOF
-
-_workout()
-{
-       echo ""
-       echo " Start defragment activity"
-       echo ""
-       cat $tmp-$seq.fio >>  $seq.full
-       run_check $FIO_PROG $tmp-$seq.fio
-}
-
-_require_fio $tmp-$seq.fio
-
-_scratch_mkfs  >> $seq.full 2>&1
-_scratch_mount
-
-if ! _workout; then
-       umount $SCRATCH_DEV 2>/dev/null
-       exit
-fi
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-_check_scratch_fs
-status=$?
-exit
diff --git a/302.out b/302.out
deleted file mode 100644 (file)
index 5491fed..0000000
--- a/302.out
+++ /dev/null
@@ -1,4 +0,0 @@
-QA output created by 302
-
- Start defragment activity
-
diff --git a/303 b/303
deleted file mode 100644 (file)
index 9bb5584..0000000
--- a/303
+++ /dev/null
@@ -1,151 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 303
-#
-# Ext4 defragmentation stress test
-# Two defrag tasks use common donor file
-#
-#-----------------------------------------------------------------------
-# (c) 2013 Dmitry Monakhov
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.defrag
-
-# real QA test starts here
-_supported_os Linux
-_supported_fs ext4
-_need_to_be_root
-_require_scratch
-_require_defrag
-
-BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
-# We need space for 3 files (one donor file and two test files)
-# Reserve space for 4 files in order to avoid ENOSPC
-FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
-
-cat >$tmp-$seq.fio <<EOF
-# Common e4defrag regression tests
-[global]
-ioengine=ioe_e4defrag
-iodepth=1
-directory=${SCRATCH_MNT}
-filesize=${FILE_SIZE}
-size=999G
-buffered=0
-fadvise_hint=0
-group_reporting
-
-#################################
-# Test3
-# Two defrag tasks use common donor file
-[defrag-1]
-ioengine=e4defrag
-iodepth=1
-bs=128k
-donorname=test3.def
-filename=test31
-inplace=0
-rw=write
-numjobs=${LOAD_FACTOR}
-runtime=30*${TIME_FACTOR}
-time_based
-
-[defrag-2]
-ioengine=e4defrag
-iodepth=1
-bs=128k
-donorname=test3.def
-filename=test32
-inplace=0
-rw=write
-numjobs=${LOAD_FACTOR}
-runtime=30*${TIME_FACTOR}
-time_based
-
-[aio-dio-verifier-1]
-ioengine=libaio
-iodepth=128*${LOAD_FACTOR}
-numjobs=1
-verify=crc32c-intel
-verify_fatal=1
-verify_dump=1
-verify_backlog=1024
-verify_async=1
-verifysort=1
-direct=1
-bs=64k
-rw=write
-filename=test31
-runtime=30*${TIME_FACTOR}
-time_based
-
-[aio-buffer-verifier-2]
-ioengine=libaio
-numjobs=1
-verify=crc32c-intel
-verify_fatal=1
-verify_dump=1
-verify_backlog=1024
-verify_async=1
-verifysort=1
-buffered=1
-bs=64k
-rw=randrw
-filename=test32
-runtime=30*${TIME_FACTOR}
-time_based
-
-EOF
-
-_workout()
-{
-       echo ""
-       echo " Start defragment activity"
-       echo ""
-       cat $tmp-$seq.fio >>  $seq.full
-       run_check $FIO_PROG $tmp-$seq.fio
-}
-
-_require_fio $tmp-$seq.fio
-
-_scratch_mkfs  >> $seq.full 2>&1
-_scratch_mount
-
-if ! _workout; then
-       umount $SCRATCH_DEV 2>/dev/null
-       exit
-fi
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-_check_scratch_fs
-status=$?
-exit
diff --git a/303.out b/303.out
deleted file mode 100644 (file)
index a7a2e67..0000000
--- a/303.out
+++ /dev/null
@@ -1,4 +0,0 @@
-QA output created by 303
-
- Start defragment activity
-
diff --git a/304 b/304
deleted file mode 100644 (file)
index f9b3721..0000000
--- a/304
+++ /dev/null
@@ -1,128 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 304
-#
-# Ext4 defragmentation stress test
-# Several threads perform defragmentation at random position
-# using 'inplace' mode (allocate and free blocks inside defrag event)
-# which significantly improve load pressure on block allocator.
-#-----------------------------------------------------------------------
-# (c) 2013 Dmitry Monakhov
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-. ./common.defrag
-
-# real QA test starts here
-_supported_os Linux
-_supported_fs ext4
-_need_to_be_root
-_require_scratch
-_require_defrag
-
-BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
-# We need space for 2 files (test file, and donor one)
-# reserve 30% in order to avoid ENOSPC
-FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
-
-cat >$tmp-$seq.fio <<EOF
-# Common e4defrag regression tests
-[global]
-ioengine=ioe_e4defrag
-iodepth=1
-directory=${SCRATCH_MNT}
-filesize=${FILE_SIZE}
-size=999G
-buffered=0
-fadvise_hint=0
-group_reporting
-
-#################################
-# Test4
-# Stress test defragmentation engine
-# Several threads perform defragmentation at random position
-# use inplace=1 will allocate and free blocks inside defrag event
-# which highly increase defragmentation
-[defrag-fuzzer]
-ioengine=e4defrag
-iodepth=1
-bs=8k
-donorname=test4.def
-filename=test4
-inplace=1
-rw=randwrite
-numjobs=4*${LOAD_FACTOR}
-runtime=30*${TIME_FACTOR}
-time_based
-
-[aio-dio-verifier]
-ioengine=libaio
-iodepth=128
-iomem_align=4k
-numjobs=1
-verify=crc32c-intel
-verify_fatal=1
-verify_dump=1
-verify_backlog=1024
-verify_async=1
-verifysort=1
-direct=1
-bs=64k
-rw=write
-filename=test4
-runtime=30*${TIME_FACTOR}
-time_based
-
-EOF
-
-_workout()
-{
-       echo ""
-       echo " Start defragment activity"
-       echo ""
-       cat $tmp-$seq.fio >>  $seq.full
-       run_check $FIO_PROG $tmp-$seq.fio
-}
-
-_require_fio $tmp-$seq.fio
-
-_scratch_mkfs  >> $seq.full 2>&1
-_scratch_mount
-
-if ! _workout; then
-       umount $SCRATCH_DEV 2>/dev/null
-       exit
-fi
-
-if ! _scratch_unmount; then
-       echo "failed to umount"
-       status=1
-       exit
-fi
-_check_scratch_fs
-status=$?
-exit
diff --git a/304.out b/304.out
deleted file mode 100644 (file)
index c8615d6..0000000
--- a/304.out
+++ /dev/null
@@ -1,4 +0,0 @@
-QA output created by 304
-
- Start defragment activity
-
diff --git a/305 b/305
deleted file mode 100644 (file)
index 4cc1a20..0000000
--- a/305
+++ /dev/null
@@ -1,184 +0,0 @@
-#! /bin/bash
-# FSQA Test No. 305
-#
-# Run fsstress and fio(dio/aio and mmap) and simulate disk failure
-# check filesystem consistency at the end.
-#
-#-----------------------------------------------------------------------
-# (c) 2013 Dmitry Monakhov
-#
-# 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`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-_supported_fs ext3 ext4 xfs btrfs reiserfs
-_supported_os Linux
-_need_to_be_root
-_require_scratch
-_require_fail_make_request
-
-# TODO: Function are common enough to be moved to common.blkdev
-SCRATCH_REAL_DEV=`readlink -f $SCRATCH_DEV`
-SCRATCH_BDEV=`basename $SCRATCH_REAL_DEV`
-
-allow_fail_make_request()
-{
-    echo "Allow global fail_make_request feature"
-    echo 100 > $DEBUGFS_MNT/fail_make_request/probability
-    echo 9999999 > $DEBUGFS_MNT/fail_make_request/times
-    echo 0 >  /sys/kernel/debug/fail_make_request/verbose
-}
-
-disallow_fail_make_request()
-{
-    echo "Disallow global fail_make_request feature"
-    echo 0 > $DEBUGFS_MNT/fail_make_request/probability
-    echo 0 > $DEBUGFS_MNT/fail_make_request/times
-}
-
-start_fail_scratch_dev()
-{
-    echo "Force SCRATCH_DEV device failure"
-    echo " echo 1 > /sys/block/$SCRATCH_BDEV/make-it-fail" >> $here/$seq.full
-    echo 1 > /sys/block/$SCRATCH_BDEV/make-it-fail
-
-}
-
-stop_fail_scratch_dev()
-{
-    echo "Make SCRATCH_DEV device operable again"
-    echo " echo 0 > /sys/block/$SCRATCH_BDEV/make-it-fail" >> $here/$seq.full
-    echo 0 > /sys/block/$SCRATCH_BDEV/make-it-fail
-
-}
-
-_cleanup()
-{
-    poweron_scratch_dev
-    disallow_fail_make_request
-}
-trap "_cleanup; exit \$status" 1 2 3 15
-
-RUN_TIME=$((20+10*$TIME_FACTOR))
-NUM_JOBS=$((4*LOAD_FACTOR))
-BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
-FILE_SIZE=$((BLK_DEV_SIZE * 512))
-
-cat >$tmp-$seq.fio <<EOF
-###########
-# $seq test's fio activity
-# Filenames derived from jobsname and jobid like follows:
-# ${JOB_NAME}.${JOB_ID}.${ITERATION_ID}
-[global]
-ioengine=libaio
-bs=4k
-directory=${SCRATCH_MNT}
-filesize=${FILE_SIZE}
-size=9999T
-continue_on_error=write
-ignore_error=EIO,ENOSPC:EIO
-error_dump=0
-
-[stress_dio_aio_activity]
-create_on_open=1
-fallocate=none
-iodepth=128*${LOAD_FACTOR}
-direct=1
-buffered=0
-numjobs=${NUM_JOBS}
-rw=randwrite
-runtime=40+${RUN_TIME}
-time_based
-
-[stress_mmap_activity]
-ioengine=mmap
-create_on_open=0
-fallocate=1
-fdatasync=40960
-filesize=8M
-size=9999T
-numjobs=${NUM_JOBS}
-rw=randwrite
-runtime=40+${RUN_TIME}
-time_based
-
-EOF
-
-_require_fio $tmp-$seq.fio
-
-# Disable all sync operations to get higher load
-FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0 -f setattr=1"
-
-_workout()
-{
-       out=$SCRATCH_MNT/fsstress.$$
-       args=`_scale_fsstress_args -p 1 -n999999999 -f setattr=0 $FSSTRESS_AVOID -d $out`
-       echo ""
-       echo "Start fsstress.."
-       echo ""
-       echo "fsstress $args" >> $here/$seq.full
-       $FSSTRESS_PROG $args > /dev/null 2>&1 &
-       fs_pid=$!
-       echo "Start fio.."
-       cat $tmp-$seq.fio >>  $seq.full
-       $FIO_PROG $tmp-$seq.fio >> $here/$seq.full 2>&1 &
-       fio_pid=$!
-
-       # Let's it work for awhile, and force device failure
-       sleep $RUN_TIME
-       start_fail_scratch_dev
-       # After device turns in to failed state filesystem may yet not know about
-       # that so buffered write(2) may succeed, but any integrity operations
-       # such as (sync, fsync, fdatasync, direct-io) should fail.
-       dd if=/dev/zero of=$SCRATCH_MNT/touch_failed_filesystem count=1 bs=4k conv=fsync \
-           >> $here/$seq.full 2>&1 && \
-           _fail "failed: still able to perform integrity fsync on $SCRATCH_MNT"
-
-       kill $fs_pid
-       wait $fs_pid
-       wait $fio_pid
-
-       # We expect that broken FS still can be umounted
-       run_check umount $SCRATCH_DEV
-       # Once filesystem was umounted no one is able to write to block device
-       # It is now safe to bring device back to normal state
-       stop_fail_scratch_dev
-
-       # In order to check that filesystem is able to recover journal on mount(2)
-       # perform mount/umount, after that all errors should be fixed
-       run_check _scratch_mount
-       run_check _scratch_unmount
-       _check_scratch_fs
-}
-
-# real QA test starts here
-
-_scratch_mkfs >> $here/$seq.full 2>&1 || _fail "mkfs failed"
-_scratch_mount || _fail "mount failed"
-allow_fail_make_request
-_workout
-status=$?
-disallow_fail_make_request
-exit
diff --git a/305.out b/305.out
deleted file mode 100644 (file)
index 1e8cfd6..0000000
--- a/305.out
+++ /dev/null
@@ -1,9 +0,0 @@
-QA output created by 305
-Allow global fail_make_request feature
-
-Start fsstress..
-
-Start fio..
-Force SCRATCH_DEV device failure
-Make SCRATCH_DEV device operable again
-Disallow global fail_make_request feature
diff --git a/307 b/307
deleted file mode 100644 (file)
index 0653833..0000000
--- a/307
+++ /dev/null
@@ -1,94 +0,0 @@
-#! /bin/bash
-# FS QA Test No. 307
-#
-# run basic btrfs information commands in various ways
-# sanity tests: filesystem show, label, sync, and device stats
-#
-#-----------------------------------------------------------------------
-# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
-#
-# 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`
-echo "== QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1       # failure is the default!
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-_cleanup()
-{
-    cd /
-    rm -f $tmp.*
-}
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./btrfs.filter
-
-# real QA test starts here
-
-# Modify as appropriate.
-_supported_fs btrfs
-_supported_os Linux
-_require_scratch
-_require_scratch_dev_pool
-
-rm -f $seq.full
-
-FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
-LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
-TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
-LABEL=TestLabel.$seq
-
-echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
-
-_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
-
-# These have to be done unmounted...?
-echo "== Set filesystem label to $LABEL"
-$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
-echo "== Get filesystem label"
-$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
-
-echo "== Mount."
-_scratch_mount
-
-echo "== Show filesystem by label"
-$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
-UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
-
-echo "UUID $UUID" >> $seq.full
-
-echo "== Show filesystem by UUID"
-$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
-
-echo "== Sync filesystem"
-$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
-
-echo "== Show device stats by mountpoint"
-$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
-echo "== Show device stats by first/scratch dev"
-$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
-echo "== Show device stats by second dev"
-$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
-echo "== Show device stats by last dev"
-$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
-
-# success, all done
-status=0
-exit
diff --git a/307.out b/307.out
deleted file mode 100644 (file)
index ea9a621..0000000
--- a/307.out
+++ /dev/null
@@ -1,41 +0,0 @@
-== QA output created by 307
-== Set filesystem label to TestLabel.307
-== Get filesystem label
-TestLabel.307
-== Mount.
-== Show filesystem by label
-Label: 'TestLabel.307'  uuid: <UUID>
-       Total devices <EXACTNUM> FS bytes used <SIZE>
-       devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-
-== Show filesystem by UUID
-Label: 'TestLabel.307'  uuid: <EXACTUUID>
-       Total devices <EXACTNUM> FS bytes used <SIZE>
-       devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-
-== Sync filesystem
-FSSync 'SCRATCH_MNT'
-== Show device stats by mountpoint
-      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
-      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
-      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
-      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
-      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
-== Show device stats by first/scratch dev
-[SCRATCH_DEV].corruption_errs <NUM>
-[SCRATCH_DEV].flush_io_errs   <NUM>
-[SCRATCH_DEV].generation_errs <NUM>
-[SCRATCH_DEV].read_io_errs    <NUM>
-[SCRATCH_DEV].write_io_errs   <NUM>
-== Show device stats by second dev
-[FIRST_POOL_DEV].write_io_errs   0
-[FIRST_POOL_DEV].read_io_errs    0
-[FIRST_POOL_DEV].flush_io_errs   0
-[FIRST_POOL_DEV].corruption_errs 0
-[FIRST_POOL_DEV].generation_errs 0
-== Show device stats by last dev
-[LAST_POOL_DEV].write_io_errs   0
-[LAST_POOL_DEV].read_io_errs    0
-[LAST_POOL_DEV].flush_io_errs   0
-[LAST_POOL_DEV].corruption_errs 0
-[LAST_POOL_DEV].generation_errs 0
diff --git a/check b/check
index 42b25b562ffe05c11af98f4cea96b988790a0399..195c25d1ea3c87128878ac788691e4b4d077d29d 100755 (executable)
--- a/check
+++ b/check
@@ -36,9 +36,8 @@ here=`pwd`
 FSTYP=xfs
 
 SUPPORTED_TESTS="[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]"
-TEST_GROUP_DIR="tests"
-GENERIC_GROUP_DIR="$TEST_GROUP_DIR/generic"
-XFS_GROUP_DIR="$TEST_GROUP_DIR/xfs"
+SRC_DIR="tests"
+SRC_GROUPS="generic shared"
 
 # generic initialization
 iam=check
@@ -87,13 +86,12 @@ _setenvironment()
 get_group_list()
 {
        grp=$1
-       dirs=". $GENERIC_GROUP_DIR $XFS_GROUP_DIR"
 
-       for d in $dirs; do
-               l=$(sed -n < $d/group \
+       for d in $SRC_GROUPS $FSTYP; do
+               l=$(sed -n < $SRC_DIR/$d/group \
                        -e 's/#.*//' \
                        -e 's/$/ /' \
-                       -e "s;\(^[0-9][0-9][0-9]\).* $grp .*;$d/\1;p")
+                       -e "s;\(^[0-9][0-9][0-9]\).* $grp .*;$SRC_DIR/$d/\1;p")
                grpl="$grpl $l"
        done
        echo $grpl
@@ -297,7 +295,7 @@ END { if (NR > 0) {
 
        echo "" >>check.log
        date >>check.log
-       echo $list | fmt | sed -e 's/^/    /' -e 's;tests/;;g' >>check.log
+       echo $list | fmt | sed -e 's/^/    /' -e "s;$SRC_DIR/;;g" >>check.log
        $interrupt && echo "Interrupted!" >>check.log
         
         if [ ! -z "$n_try" -a $n_try != 0 ]
@@ -378,7 +376,7 @@ do
 
     # the filename for the test and the name output are different.
     # we don't include the tests/ directory in the name output.
-    seqnum=`echo $seq | sed -e 's;tests/;;'`
+    seqnum=`echo $seq | sed -e "s;$SRC_DIR/;;"`
 
     echo -n "$seqnum"
 
diff --git a/group b/group
index d1469709aca4d531e146a613dc59bb7d1f54866e..4e01f0c1d480e3bfd3947f2192cfcdbde4d1dd0c 100644 (file)
--- a/group
+++ b/group
@@ -3,29 +3,3 @@
 # - do not start group names with a digit
 # - comment line before each group is "new" description
 #
-# test-group association ... one line per test
-#
-032 mkfs auto quick
-040 other auto
-051 acl udf auto quick
-098 udf auto
-101 udf
-102 udf
-177 rw other auto
-218 auto fsr quick
-243 auto quick prealloc
-254 auto quick
-264 auto
-265 auto
-271 auto rw quick
-272 auto enospc rw
-276 auto rw metadata
-284 auto
-289 auto quick
-298 auto trim
-301 aio dangerous ioctl rw stress
-302 aio dangerous ioctl rw stress
-303 aio dangerous ioctl rw stress
-304 aio dangerous ioctl rw stress
-305 aio dangerous enospc rw stress
-307 auto quick
diff --git a/tests/btrfs/254 b/tests/btrfs/254
new file mode 100755 (executable)
index 0000000..73089d1
--- /dev/null
@@ -0,0 +1,106 @@
+#! /bin/bash
+# FS QA Test No. 254
+#
+# Test btrfs's subvolume and snapshot support
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2011 Red Hat.  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+
+_cleanup()
+{
+    rm -f $tmp.*
+}
+
+trap "_cleanup ; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+_scratch_mkfs > /dev/null 2>&1
+_scratch_mount
+
+# First test basic snapshotting
+echo "Creating file foo in root dir"
+dd if=/dev/zero of=$SCRATCH_MNT/foo bs=1M count=1 &> /dev/null
+echo "List root dir"
+ls $SCRATCH_MNT
+echo "Creating snapshot of root dir"
+btrfs subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap | _filter_scratch
+echo "List root dir after snapshot"
+ls $SCRATCH_MNT
+echo "List snapshot dir"
+ls $SCRATCH_MNT/snap
+rm -f $SCRATCH_MNT/foo
+echo "List root dir after rm of foo"
+ls $SCRATCH_MNT
+echo "List snapshot dir"
+ls $SCRATCH_MNT/snap
+
+# Test creating a normal subvolme
+btrfs subvolume create $SCRATCH_MNT/subvol | _filter_scratch
+echo "Listing root dir"
+ls $SCRATCH_MNT
+echo "Listing subvol"
+ls $SCRATCH_MNT/subvol
+
+# Test setting a default mount
+echo "Creating file bar in subvol"
+dd if=/dev/zero of=$SCRATCH_MNT/subvol/bar bs=1M count=1 &> /dev/null
+echo "Setting subvol to the default"
+btrfs subvolume set-default 0 $SCRATCH_MNT/subvol | _filter_scratch
+_scratch_remount
+echo "List root dir which is now subvol"
+ls $SCRATCH_MNT
+_scratch_unmount
+echo "Mounting sbuvolid=0 for the root dir"
+_scratch_mount "-o subvolid=0"
+echo "List root dir"
+ls $SCRATCH_MNT
+echo "Setting the root dir as the default again"
+btrfs subvolume set-default 0 $SCRATCH_MNT | _filter_scratch
+_scratch_remount
+echo "List root dir"
+ls $SCRATCH_MNT
+
+# Test listing the subvolumes
+echo "Listing subvolumes"
+btrfs subvolume list $SCRATCH_MNT | awk '{ print $NF }'
+
+# Delete the snapshot
+btrfs subvolume delete $SCRATCH_MNT/snap | _filter_scratch
+echo "List root dir"
+ls $SCRATCH_MNT
+_scratch_remount
+echo "List root dir"
+ls $SCRATCH_MNT
+
+status=0 ; exit
diff --git a/tests/btrfs/254.out b/tests/btrfs/254.out
new file mode 100644 (file)
index 0000000..d4b5346
--- /dev/null
@@ -0,0 +1,40 @@
+QA output created by 254
+Creating file foo in root dir
+List root dir
+foo
+Creating snapshot of root dir
+Create a snapshot of 'SCRATCH_MNT' in 'SCRATCH_MNT/snap'
+List root dir after snapshot
+foo
+snap
+List snapshot dir
+foo
+List root dir after rm of foo
+snap
+List snapshot dir
+foo
+Create subvolume 'SCRATCH_MNT/subvol'
+Listing root dir
+snap
+subvol
+Listing subvol
+Creating file bar in subvol
+Setting subvol to the default
+List root dir which is now subvol
+bar
+Mounting sbuvolid=0 for the root dir
+List root dir
+snap
+subvol
+Setting the root dir as the default again
+List root dir
+snap
+subvol
+Listing subvolumes
+snap
+subvol
+Delete subvolume 'SCRATCH_MNT/snap'
+List root dir
+subvol
+List root dir
+subvol
diff --git a/tests/btrfs/264 b/tests/btrfs/264
new file mode 100755 (executable)
index 0000000..a589c7c
--- /dev/null
@@ -0,0 +1,191 @@
+#!/bin/bash
+# FS QA Test No. 264
+#
+# Extented btrfs snapshot test cases
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2011 Oracle  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+
+_cleanup()
+{
+    rm -f $tmp.*
+}
+
+trap "_cleanup ; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+
+_scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+_scratch_mount
+
+# Create and save sha256sum
+# arg1 FS to generate sha256
+# arg2 File name to save the sha256 output
+_save_checksum()
+{
+       local i=0
+       >$2
+       cd $1
+       for i in `find . -type f`; do sha256sum $i >> $2; done
+       cd $OLDPWD
+}
+
+# Verify the sha256sum for a FS
+# arg1 FS to be tested
+# arg2 sha256 file
+_verify_checksum()
+{
+       cd $1
+       [ -f $2 ] || _fail "checksum file $2 not found"
+       sha256sum -c $2 | grep "FAILED"
+       cd $OLDPWD
+}
+
+# Create a snapshot
+# arg1 dest dir
+# Return snapshot name in the SNAPNAME
+_create_snap()
+{
+       local x
+       [ -d $1 ] || _fail "Destination dir $1 not present"
+       SNAPNAME=`mktemp -u $SCRATCH_MNT/snap.XXXXXX`
+       btrfs subvolume snapshot $1 $SNAPNAME > /dev/null || _fail "snapshot create failed"
+}
+
+# Reads and writes new data but does not allocate new blocks
+# arg1 FS to be modified
+_read_modify_write()
+{
+       local i
+       local FSIZE
+       for i in `find $1 -type f`
+       do
+               FSIZE=`stat -t $i | cut -d" " -f2`
+               dd if=$i of=/dev/null obs=$FSIZE count=1 status=noxfer 2>/dev/null &
+               dd if=/dev/urandom of=$i obs=$FSIZE count=1 status=noxfer 2>/dev/null &
+       done
+       wait $!
+}
+
+# Fills the allocated blocks
+# arg1 FS in question
+_fill_blk()
+{
+       local FSIZE
+       local BLKS
+       local NBLK
+       local FALLOC
+       local WS
+
+       for i in `find /$1 -type f`
+       do
+               FSIZE=`stat -t $i | cut -d" " -f2`
+               BLKS=`stat -c "%B" $i`
+               NBLK=`stat -c "%b" $i`
+               FALLOC=$(($BLKS * $NBLK))
+               WS=$(($FALLOC - $FSIZE))
+               dd if=/dev/urandom of=$i oseek=$FSIZE obs=$WS count=1 status=noxfer 2>/dev/null &
+       done
+       wait $!
+}
+
+
+# Append a random size to the files
+# arg1 : FS in question
+_append_file()
+{
+       local FSIZE
+       local X
+       local N
+       local i
+       N=0
+       for i in `find $1 -type f`
+       do
+               if [ $N == 0 ]; then
+                       X=$i
+                       FSIZE=`stat -t $X | cut -d" " -f2`
+                       dd if=$X of=$X seek=1 bs=$FSIZE obs=$FSIZE count=1 status=noxfer 2>/dev/null &
+                       N=$(($N+1))
+                       continue
+               fi
+               FSIZE=`stat -t $i | cut -d" " -f2`
+               dd if=$X of=$i seek=1 bs=$FSIZE obs=$FSIZE count=1 status=noxfer 2>/dev/null &
+               X=$i
+       done
+       wait $!
+}
+
+##################### real QA test starts here###################################
+# sv1 - is just a name nothing spl
+firstvol="$SCRATCH_MNT/sv1"
+btrfs subvolume create $firstvol > /dev/null || _fail "btrfs subvolume create $firstvol failed"
+dirp=`mktemp -duq $firstvol/dir.XXXXXX`
+_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10 -x
+SNAPNAME=0
+_create_snap $firstvol
+_save_checksum $firstvol $tmp.sv1.sum
+_verify_checksum $SNAPNAME $tmp.sv1.sum
+
+#Append1 the files
+_fill_blk $SNAPNAME
+_verify_checksum $firstvol $tmp.sv1.sum
+
+#Append2 the files
+_append_file $SNAPNAME
+_verify_checksum $firstvol $tmp.sv1.sum
+
+#read modify write
+_read_modify_write $SNAPNAME
+_verify_checksum $firstvol $tmp.sv1.sum
+
+#nested snapshot test
+src_vol=$firstvol
+for i in `seq 1 7`; do
+       SNAPNAME=0
+       _create_snap $src_vol
+       _verify_checksum $SNAPNAME $tmp.sv1.sum
+       src_vol=$SNAPNAME
+done
+
+# file delete test
+SNAPNAME=0
+_create_snap $firstvol
+tname=`echo $SNAPNAME | rev | cut -d"/" -f1 | rev`
+_save_checksum $SNAPNAME $tmp.$tname.sum
+\rm -rf $firstvol/*
+_verify_checksum $SNAPNAME $tmp.$tname.sum
+
+umount $SCRATCH_DEV || _fail "unmount failed"
+
+echo "Silence is golden"
+status=0; exit
diff --git a/tests/btrfs/264.out b/tests/btrfs/264.out
new file mode 100644 (file)
index 0000000..eca790b
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 264
+Silence is golden
diff --git a/tests/btrfs/265 b/tests/btrfs/265
new file mode 100755 (executable)
index 0000000..f28d4e5
--- /dev/null
@@ -0,0 +1,185 @@
+#! /bin/bash
+# FS QA Test No. 265
+#
+# btrfs vol tests
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2011 Oracle.  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+dev_removed=0
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+    if [ $dev_removed == 1 ]; then
+        umount $SCRATCH_MNT
+        _devmgt_add "${DEVHTL}"
+    fi
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+_require_deletable_scratch_dev_pool
+
+# Test cases related to raid in btrfs
+_test_raid0()
+{
+       export MKFS_OPTIONS="-m raid0 -d raid0"
+       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+       umount $SCRATCH_MNT
+}
+
+_test_raid1()
+{
+       export MKFS_OPTIONS="-m raid1 -d raid1"
+       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+       umount $SCRATCH_MNT
+}
+
+_test_raid10()
+{
+       export MKFS_OPTIONS="-m raid10 -d raid10"
+       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+       umount $SCRATCH_MNT
+}
+
+_test_single()
+{
+       export MKFS_OPTIONS="-m single -d single"
+       _scratch_mkfs $SCRATCH_DEV_POOL > /dev/null 2>&1 || _fail "mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+       umount $SCRATCH_MNT
+}
+
+_test_add()
+{
+       local i
+       local devs[]="( $SCRATCH_DEV_POOL )"
+       local n=${#devs[@]}
+
+       n=$(($n-1))
+
+       export MKFS_OPTIONS=""
+       _scratch_mkfs > /dev/null 2>&1 || _fail "mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+       for i in `seq 1 $n`; do
+               btrfs device add ${devs[$i]} $SCRATCH_MNT > /dev/null 2>&1 || _fail "device add failed"
+       done
+       btrfs filesystem balance $SCRATCH_MNT || _fail "balance failed"
+       umount $SCRATCH_MNT
+}
+
+_test_replace()
+{
+       local i
+       local devs=( $SCRATCH_DEV_POOL )
+       local n=${#devs[@]}
+       local ds
+       local d
+       local DEVHTL=""
+
+       # exclude the last disk in the disk pool
+       n=$(($n-1))
+       ds=${devs[@]:0:$n}
+
+       export MKFS_OPTIONS="-m raid1 -d raid1"
+       _scratch_mkfs "$ds" > /dev/null 2>&1 || _fail "tr: mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+
+       #pick the 2nd last disk 
+       ds=${devs[@]:$(($n-1)):1}
+
+       # retrive the HTL for this scsi disk
+       d=`echo $ds|cut -d"/" -f3`
+       DEVHTL=`ls -l /sys/class/block/${d} | rev | cut -d "/" -f 3 | rev`
+
+       #fail disk
+       _devmgt_remove ${DEVHTL}
+       dev_removed=1
+
+       btrfs fi show $SCRATCH_DEV | grep "Some devices missing" > /dev/null || _fail \
+                                                       "btrfs did not report device missing"
+
+       # add a new disk to btrfs
+       ds=${devs[@]:$(($n)):1}
+       btrfs device add ${ds} $SCRATCH_MNT > /dev/null 2>&1 || _fail "dev add failed"
+       # in some system balance fails if there is no delay (a bug)
+       # putting sleep 10 to work around as of now
+       # sleep 10
+       btrfs fi balance $SCRATCH_MNT || _fail "dev balance failed"
+
+       # cleaup. add the removed disk
+       umount $SCRATCH_MNT
+       _devmgt_add "${DEVHTL}"
+       dev_removed=0
+}
+
+_test_remove()
+{
+       _scratch_mkfs "$SCRATCH_DEV_POOL" > /dev/null 2>&1 || _fail "mkfs failed"
+       _scratch_mount
+       dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
+       _populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
+
+       # pick last dev in the list
+       dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
+       btrfs device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
+       btrfs fi show $SCRATCH_DEV 2>&1 | grep $dev_del > /dev/null && _fail "btrfs still shows the deleted dev"
+       umount $SCRATCH_MNT
+}
+
+_test_raid0
+_test_raid1
+_test_raid10
+_test_single
+_test_add
+_test_replace
+_test_remove
+
+echo "Silence is golden"
+status=0; exit
diff --git a/tests/btrfs/265.out b/tests/btrfs/265.out
new file mode 100644 (file)
index 0000000..9fa4eb0
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 265
+Silence is golden
diff --git a/tests/btrfs/276 b/tests/btrfs/276
new file mode 100755 (executable)
index 0000000..07d288c
--- /dev/null
@@ -0,0 +1,269 @@
+#! /bin/bash
+# FSQA Test No. 276
+#
+# Run fsstress to create a reasonably strange file system, make a
+# snapshot and run more fsstress. Then select some files from that fs,
+# run filefrag to get the extent mapping and follow the backrefs.
+# We check to end up back at the original file with the correct offset.
+#
+#-----------------------------------------------------------------------
+# Copyright (C) 2011 STRATO.  All rights reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1
+noise_pid=0
+
+_cleanup()
+{
+       if [ $noise_pid -ne 0 ]; then
+               echo "background noise kill $noise_pid" >>$seq.full
+               kill $noise_pid
+               noise_pid=0
+               wait
+       fi
+       echo "*** unmount"
+       umount $SCRATCH_MNT 2>/dev/null
+       rm -f $tmp.*
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_need_to_be_root
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_no_large_scratch_dev
+_require_btrfs inspect-internal
+_require_command "/usr/sbin/filefrag"
+
+rm -f $seq.full
+
+FILEFRAG_FILTER='if (/, blocksize (\d+)/) {$blocksize = $1; next} ($ext, '\
+'$logical, $physical, $expected, $length, $flags) = (/^\s*(\d+)\s+(\d+)'\
+'\s+(\d+)\s+(?:(\d+)\s+)?(\d+)\s+(.*)/) or next; $flags =~ '\
+'/(?:^|,)inline(?:,|$)/ and next; print $physical * $blocksize, "#", '\
+'$length * $blocksize, "#", $logical * $blocksize, " "'
+
+# this makes filefrag output script readable by using a perl helper.
+# output is one extent per line, with three numbers separated by '#'
+# the numbers are: physical, length, logical (all in bytes)
+# sample output: "1234#10#5678" -> physical 1234, length 10, logical 5678
+_filter_extents()
+{
+       tee -a $seq.full | $PERL_PROG -ne "$FILEFRAG_FILTER"
+}
+
+_check_file_extents()
+{
+       cmd="filefrag -v $1"
+       echo "# $cmd" >> $seq.full
+       out=`$cmd | _filter_extents`
+       if [ -z "$out" ]; then
+               return 1
+       fi
+       echo "after filter: $out" >> $seq.full
+       echo $out
+       return 0
+}
+
+# use a logical address and walk the backrefs back to the inode.
+# compare to the expected result.
+# returns 0 on success, 1 on error (with output made)
+_btrfs_inspect_addr()
+{
+       mp=$1
+       addr=$2
+       expect_addr=$3
+       expect_inum=$4
+       file=$5
+       cmd="$BTRFS_UTIL_PROG inspect-internal logical-resolve -P $addr $mp"
+       echo "# $cmd" >> $seq.full
+       out=`$cmd`
+       echo "$out" >> $seq.full
+       grep_expr="inode $expect_inum offset $expect_addr root"
+       echo "$out" | grep "^$grep_expr 5$" >/dev/null
+       ret=$?
+       if [ $ret -eq 0 ]; then
+               # look for a root number that is not 5
+               echo "$out" | grep "^$grep_expr \([0-46-9][0-9]*\|5[0-9]\+\)$" \
+                       >/dev/null
+               ret=$?
+       fi
+       if [ $ret -eq 0 ]; then
+               return 0
+       fi
+       echo "unexpected output from"
+       echo "  $cmd"
+       echo "expected inum: $expect_inum, expected address: $expect_addr,"\
+               "file: $file, got:"
+       echo "$out"
+       return 1
+}
+
+# use an inode number and walk the backrefs back to the file name.
+# compare to the expected result.
+# returns 0 on success, 1 on error (with output made)
+_btrfs_inspect_inum()
+{
+       file=$1
+       inum=$2
+       snap_name=$3
+       mp="$SCRATCH_MNT/$snap_name"
+       cmd="$BTRFS_UTIL_PROG inspect-internal inode-resolve $inum $mp"
+       echo "# $cmd" >> $seq.full
+       out=`$cmd`
+       echo "$out" >> $seq.full
+       grep_expr="^$file$"
+       cnt=`echo "$out" | grep "$grep_expr" | wc -l`
+       if [ $cnt -ge "1" ]; then
+               return 0
+       fi
+       echo "unexpected output from"
+       echo "  $cmd"
+       echo "expected path: $file, got:"
+       echo "$out"
+       return 1
+}
+
+_btrfs_inspect_check()
+{
+       file=$1
+       physical=$2
+       length=$3
+       logical=$4
+       snap_name=$5
+       cmd="stat -c %i $file"
+       echo "# $cmd" >> $seq.full
+       inum=`$cmd`
+       echo "$inum" >> $seq.full
+       _btrfs_inspect_addr $SCRATCH_MNT $physical $logical $inum $file
+       ret=$?
+       if [ $ret -eq 0 ]; then
+               _btrfs_inspect_inum $file $inum $snap_name
+               ret=$?
+       fi
+       return $ret
+}
+
+workout()
+{
+       fsz=$1
+       nfiles=$2
+       procs=$3
+       snap_name=$4
+       do_bg_noise=$5
+
+       umount $SCRATCH_DEV >/dev/null 2>&1
+       echo "*** mkfs -dsize=$fsz"    >>$seq.full
+       echo ""                                     >>$seq.full
+       _scratch_mkfs_sized $fsz >>$seq.full 2>&1 \
+               || _fail "size=$fsz mkfs failed"
+       run_check _scratch_mount
+       # -w ensures that the only ops are ones which cause write I/O
+       run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \
+               $FSSTRESS_AVOID
+
+       run_check $BTRFS_UTIL_PROG subvol snap $SCRATCH_MNT \
+               $SCRATCH_MNT/$snap_name
+
+       run_check umount $SCRATCH_DEV >/dev/null 2>&1
+       run_check _scratch_mount "-o compress=lzo"
+
+       # make some noise but ensure we're not touching existing data
+       # extents.
+       run_check $FSSTRESS_PROG -d $SCRATCH_MNT -p $procs -n 4000 \
+               -z -f chown=3 -f link=1 -f mkdir=2 -f mknod=2 \
+               -f rename=2 -f setxattr=1 -f symlink=2
+
+       clean_dir="$SCRATCH_MNT/next"
+       mkdir $clean_dir
+       # now make more files to get a higher tree
+       run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
+               $FSSTRESS_AVOID
+       run_check umount $SCRATCH_DEV >/dev/null 2>&1
+       run_check _scratch_mount "-o atime"
+
+       if [ $do_bg_noise -ne 0 ]; then
+               # make background noise while backrefs are being walked
+               while /bin/true; do
+                       echo background fsstress >>$seq.full
+                       run_check $FSSTRESS_PROG -d $SCRATCH_MNT/bgnoise -n 999
+                       echo background rm >>$seq.full
+                       rm -rf $SCRATCH_MNT/bgnoise/
+               done &
+               noise_pid=`jobs -p %1`
+               echo "background noise by $noise_pid" >>$seq.full
+       fi
+
+       cnt=0
+       errcnt=0
+       dir="$SCRATCH_MNT/$snap_name/"
+       for file in `find $dir -name f\* -size +0 | sort -R`; do
+               extents=`_check_file_extents $file`
+               ret=$?
+               if [ $ret -ne 0 ]; then
+                       continue;
+               fi
+               for i in $extents; do
+                       physical=$i
+                       length=$i
+                       logical=$i
+                       physical=`echo $physical | sed -e 's/#.*//'`
+                       length=`echo $length | sed -e 's/[^#]+#//'`
+                       length=`echo $length | sed -e 's/#.*//'`
+                       logical=`echo $logical | sed -e 's/.*#//'`
+                       _btrfs_inspect_check $file $physical $length $logical \
+                                               $snap_name
+                       ret=$?
+                       if [ $ret -ne 0 ]; then
+                               errcnt=`expr $errcnt + 1`
+                       fi
+               done
+               cnt=`expr $cnt + 1`
+               if [ $cnt -ge $nfiles ]; then
+                       break
+               fi
+       done
+
+       if [ $errcnt -gt 0 ]; then
+               _fail "test failed: $errcnt error(s)"
+       fi
+}
+
+echo "*** test backref walking"
+
+snap_name="snap1"
+filesize=`expr 2000 \* 1024 \* 1024`
+nfiles=4
+numprocs=1
+do_bg_noise=1
+
+workout $filesize $nfiles $numprocs $snap_name $do_bg_noise
+
+echo "*** done"
+status=0
+exit
diff --git a/tests/btrfs/276.out b/tests/btrfs/276.out
new file mode 100644 (file)
index 0000000..2032dea
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 276
+*** test backref walking
+*** done
+*** unmount
diff --git a/tests/btrfs/284 b/tests/btrfs/284
new file mode 100644 (file)
index 0000000..b86ef32
--- /dev/null
@@ -0,0 +1,170 @@
+#! /bin/bash
+# FS QA Test No. 284
+#
+# Btrfs Online defragmentation tests
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2012 Fujitsu Liu Bo.  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+here="`pwd`"
+tmp=/tmp/$$
+cnt=11999
+filesize=48000
+
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+_create_file()
+{
+       if [ $1 -ne 2 ]; then
+               tmpfile="$SCRATCH_MNT/tmp_file"
+       else
+               mkdir -p $SCRATCH_MNT/tmp_dir
+               tmpfile="$SCRATCH_MNT/tmp_dir/tmp_file"
+       fi
+               
+       for i in `seq $cnt -1 0`; do
+               dd if=/dev/zero of=$tmpfile bs=4k count=1 \
+                conv=notrunc seek=$i oflag=sync &>/dev/null
+       done
+       # get md5sum
+       md5sum $tmpfile > /tmp/checksum
+}
+
+_btrfs_online_defrag()
+{
+       str=""
+       if [ "$2" = "2" ];then
+               str="$str -s -1 -l $((filesize / 2)) "
+       elif [ "$2" = "3" ];then
+               str="$str -s $((filesize + 1)) -l $((filesize / 2)) "
+               HAVE_DEFRAG=1
+       elif [ "$2" = "4" ];then
+               str="$str -l -1 "
+       elif [ "$2" = "5" ];then
+               str="$str -l $((filesize + 1)) "
+       elif [ "$2" = "6" ];then
+               str="$str -l $((filesize / 2)) "
+       fi
+
+       if [ "$3" = "2" ];then
+               str="$str -c "
+       fi
+
+       if [ "$str" != "" ]; then
+               btrfs filesystem defragment $str $SCRATCH_MNT/tmp_file
+       else
+               if [ "$1" = "1" ];then
+                       btrfs filesystem defragment $SCRATCH_MNT/tmp_file
+               elif [ "$1" = "2" ];then
+                       btrfs filesystem defragment $SCRATCH_MNT/tmp_dir
+               elif [ "$1" = "3" ];then
+                       btrfs filesystem defragment $SCRATCH_MNT
+               fi
+       fi
+       ret_val=$?
+       _scratch_remount
+       if [ $ret_val -ne 20 ];then
+               echo "btrfs filesystem defragment failed! err is $ret_val"
+       fi
+}
+
+_checksum()
+{
+       md5sum -c /tmp/checksum > /dev/null 2>&1
+       if [ $? -ne 0 ]; then
+               echo "md5 checksum failed!"
+       fi
+}
+
+_cleanup_defrag()
+{
+       umount $SCRATCH_MNT > /dev/null 2>&1
+}
+
+_setup_defrag()
+{
+       umount $SCRATCH_MNT > /dev/null 2>&1
+       _scratch_mkfs > /dev/null 2>&1
+       _scratch_mount
+       _create_file $1
+}
+
+_rundefrag()
+{
+       _setup_defrag $1
+       _btrfs_online_defrag $1 $2 $3
+       _checksum
+       _cleanup_defrag
+       _check_scratch_fs
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.defrag
+
+# real QA test starts here
+_supported_fs btrfs
+_supported_os Linux
+
+_setup_testdir
+## We require scratch so that we'll have free contiguous space
+_require_scratch
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+_require_defrag
+
+echo "defrag object | defragment range | defragment compress"
+echo "a single file |  default | off"
+_rundefrag 1 1 1
+
+echo "a single file | default |  on"
+_rundefrag 1 1 2
+
+echo "a single file | start < 0 && 0 < len < file size | off"
+_rundefrag 1 2 1
+
+echo "a single file | start > file size && 0 < len < file size | off"
+_rundefrag 1 3 1
+
+echo "a single file | start = 0 && len < 0 | off"
+_rundefrag 1 4 1
+
+echo "a single file | start = 0 && len > file size | off"
+_rundefrag 1 5 1
+
+echo "a single file | start = 0 && 0 < len < file size | off"
+_rundefrag 1 6 1
+
+echo "a directory | default | off"
+_rundefrag 2 1 1
+
+echo "a filesystem | default | off"
+_rundefrag 3 1 1
+
+status=0
+exit
diff --git a/tests/btrfs/284.out b/tests/btrfs/284.out
new file mode 100644 (file)
index 0000000..4a69f82
--- /dev/null
@@ -0,0 +1,11 @@
+QA output created by 284
+defrag object | defragment range | defragment compress
+a single file |  default | off
+a single file | default |  on
+a single file | start < 0 && 0 < len < file size | off
+a single file | start > file size && 0 < len < file size | off
+a single file | start = 0 && len < 0 | off
+a single file | start = 0 && len > file size | off
+a single file | start = 0 && 0 < len < file size | off
+a directory | default | off
+a filesystem | default | off
diff --git a/tests/btrfs/307 b/tests/btrfs/307
new file mode 100644 (file)
index 0000000..0653833
--- /dev/null
@@ -0,0 +1,94 @@
+#! /bin/bash
+# FS QA Test No. 307
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/tests/btrfs/307.out b/tests/btrfs/307.out
new file mode 100644 (file)
index 0000000..ea9a621
--- /dev/null
@@ -0,0 +1,41 @@
+== QA output created by 307
+== Set filesystem label to TestLabel.307
+== Get filesystem label
+TestLabel.307
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.307'  uuid: <UUID>
+       Total devices <EXACTNUM> FS bytes used <SIZE>
+       devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.307'  uuid: <EXACTUUID>
+       Total devices <EXACTNUM> FS bytes used <SIZE>
+       devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/tests/btrfs/group b/tests/btrfs/group
new file mode 100644 (file)
index 0000000..bc6c256
--- /dev/null
@@ -0,0 +1,11 @@
+# QA groups control file
+# Defines test groups and nominal group owners
+# - do not start group names with a digit
+# - comment line before each group is "new" description
+#
+254 auto quick
+264 auto
+265 auto
+276 auto rw metadata
+284 auto
+307 auto quick
diff --git a/tests/ext4/271 b/tests/ext4/271
new file mode 100755 (executable)
index 0000000..50b4c0b
--- /dev/null
@@ -0,0 +1,66 @@
+#! /bin/bash
+# FSQA Test No. 271
+#
+# Regression testcase for d583fb87a3ff0 (ext4 extent corruption)
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs ext4
+_supported_os Linux
+_need_to_be_root
+_require_scratch
+
+_scratch_mkfs_sized $((128 * 1024 * 1024)) >> $seq.full 2>&1
+
+# -onoload and EXT4_SYNC_FL on file is important becase result in
+# metadata sync writes inside ext4_handle_dirty_metadata()
+_scratch_mount -onoload
+touch $SCRATCH_MNT/file
+chattr +S $SCRATCH_MNT/file
+# Create sparse file 
+for ((i = 0; i < 21; i++))
+do
+    dd if=/dev/zero of=$SCRATCH_MNT/file bs=4k count=1 seek=$((i*10))
+done
+# truncate last extent
+$XFS_IO_PROG -F -f -c "truncate $((4096*200))" $SCRATCH_MNT/file
+
+if ! _scratch_unmount; then
+       echo "failed to umount"
+       status=1
+       exit
+fi
+echo "Check filesystem"
+_check_scratch_fs
+status=$?
+exit
diff --git a/tests/ext4/271.out b/tests/ext4/271.out
new file mode 100644 (file)
index 0000000..22a3c50
--- /dev/null
@@ -0,0 +1,44 @@
+QA output created by 271
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+1+0 records in
+1+0 records out
+Check filesystem
diff --git a/tests/ext4/301 b/tests/ext4/301
new file mode 100644 (file)
index 0000000..dc19c3a
--- /dev/null
@@ -0,0 +1,124 @@
+#! /bin/bash
+# FSQA Test No. 301
+#
+# Ext4 defragmentation stress test
+# Defragment file while other task does direct io
+#-----------------------------------------------------------------------
+# (c) 2013 Dmitry Monakhov
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.defrag
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs ext4
+_need_to_be_root
+_require_scratch
+_require_defrag
+
+NUM_JOBS=$((4*LOAD_FACTOR))
+BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
+# We need space for 2 files (test file, and donor one)
+# reserve 30% in order to avoid ENOSPC
+FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
+
+cat >$tmp-$seq.fio <<EOF
+# Common e4defrag regression tests
+[global]
+ioengine=ioe_e4defrag
+iodepth=1
+directory=${SCRATCH_MNT}
+filesize=${FILE_SIZE}
+size=999G
+buffered=0
+fadvise_hint=0
+group_reporting
+
+#################################
+# Test1
+# Defragment file while other task does direct io
+
+# Continious sequential defrag activity
+[defrag-4k]
+ioengine=e4defrag
+iodepth=1
+bs=128k
+donorname=test1.def
+filename=test1
+inplace=0
+rw=write
+numjobs=${NUM_JOBS}
+runtime=30*${TIME_FACTOR}
+time_based
+
+# Verifier
+[aio-dio-verifier]
+ioengine=libaio
+iodepth=128*${LOAD_FACTOR}
+numjobs=1
+verify=crc32c-intel
+verify_fatal=1
+verify_dump=1
+verify_backlog=1024
+verify_async=1
+verifysort=1
+direct=1
+bs=64k
+rw=randwrite
+filename=test1
+runtime=30*${TIME_FACTOR}
+time_based
+EOF
+
+_workout()
+{
+       echo ""
+       echo " Start defragment activity"
+       echo ""
+       cat $tmp-$seq.fio >>  $seq.full
+       run_check $FIO_PROG $tmp-$seq.fio
+}
+
+_require_fio $tmp-$seq.fio
+
+_scratch_mkfs  >> $seq.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+       umount $SCRATCH_DEV 2>/dev/null
+       exit
+fi
+
+if ! _scratch_unmount; then
+       echo "failed to umount"
+       status=1
+       exit
+fi
+_check_scratch_fs
+status=$?
diff --git a/tests/ext4/301.out b/tests/ext4/301.out
new file mode 100644 (file)
index 0000000..044a685
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 301
+
+ Start defragment activity
+
diff --git a/tests/ext4/302 b/tests/ext4/302
new file mode 100644 (file)
index 0000000..43a9517
--- /dev/null
@@ -0,0 +1,141 @@
+#! /bin/bash
+# FSQA Test No. 302
+#
+# Ext4 defragmentation stress test
+# Perform defragmentation on file under buffered io
+# while third task does direct io to donor file
+#-----------------------------------------------------------------------
+# (c) 2013 Dmitry Monakhov
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.defrag
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs ext4
+_need_to_be_root
+_require_scratch
+_require_defrag
+
+BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
+# We need space for 2 files (test file, and donor one)
+# reserve 30% in order to avoid ENOSPC
+FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
+
+cat >$tmp-$seq.fio <<EOF
+# Common e4defrag regression tests
+[global]
+ioengine=ioe_e4defrag
+iodepth=1
+directory=${SCRATCH_MNT}
+filesize=${FILE_SIZE}
+size=999G
+buffered=0
+fadvise_hint=0
+group_reporting
+
+##########################################
+# Test2
+# Perform defragmentation on file under buffered io
+# while third task does direct io to donor file
+#
+# Continuous sequential defrag activity
+[defrag-4k]
+stonewall
+ioengine=e4defrag
+iodepth=1
+bs=128k
+donorname=test2.def
+filename=test2
+inplace=0
+rw=write
+numjobs=${LOAD_FACTOR}
+runtime=30*${TIME_FACTOR}
+time_based
+
+# Run DIO/AIO for donor file
+[donor-file-fuzzer]
+ioengine=libaio
+iodepth=128*${LOAD_FACTOR}
+numjobs=${LOAD_FACTOR}
+verify=0
+direct=1
+bs=64k
+rw=randwrite
+filename=test2.def
+runtime=30*${TIME_FACTOR}
+time_based
+
+# Verifier thread
+[aio-dio-verifier]
+ioengine=libaio
+iodepth=128*${LOAD_FACTOR}
+numjobs=1
+verify=crc32c-intel
+verify_fatal=1
+verify_dump=1
+verify_backlog=1024
+verify_async=1
+verifysort=1
+buffered=1
+bs=64k
+rw=randrw
+filename=test2
+runtime=30*${TIME_FACTOR}
+time_based
+
+EOF
+
+_workout()
+{
+       echo ""
+       echo " Start defragment activity"
+       echo ""
+       cat $tmp-$seq.fio >>  $seq.full
+       run_check $FIO_PROG $tmp-$seq.fio
+}
+
+_require_fio $tmp-$seq.fio
+
+_scratch_mkfs  >> $seq.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+       umount $SCRATCH_DEV 2>/dev/null
+       exit
+fi
+
+if ! _scratch_unmount; then
+       echo "failed to umount"
+       status=1
+       exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/tests/ext4/302.out b/tests/ext4/302.out
new file mode 100644 (file)
index 0000000..5491fed
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 302
+
+ Start defragment activity
+
diff --git a/tests/ext4/303 b/tests/ext4/303
new file mode 100644 (file)
index 0000000..9bb5584
--- /dev/null
@@ -0,0 +1,151 @@
+#! /bin/bash
+# FSQA Test No. 303
+#
+# Ext4 defragmentation stress test
+# Two defrag tasks use common donor file
+#
+#-----------------------------------------------------------------------
+# (c) 2013 Dmitry Monakhov
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.defrag
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs ext4
+_need_to_be_root
+_require_scratch
+_require_defrag
+
+BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
+# We need space for 3 files (one donor file and two test files)
+# Reserve space for 4 files in order to avoid ENOSPC
+FILE_SIZE=$((BLK_DEV_SIZE * (512 / (3+1))))
+
+cat >$tmp-$seq.fio <<EOF
+# Common e4defrag regression tests
+[global]
+ioengine=ioe_e4defrag
+iodepth=1
+directory=${SCRATCH_MNT}
+filesize=${FILE_SIZE}
+size=999G
+buffered=0
+fadvise_hint=0
+group_reporting
+
+#################################
+# Test3
+# Two defrag tasks use common donor file
+[defrag-1]
+ioengine=e4defrag
+iodepth=1
+bs=128k
+donorname=test3.def
+filename=test31
+inplace=0
+rw=write
+numjobs=${LOAD_FACTOR}
+runtime=30*${TIME_FACTOR}
+time_based
+
+[defrag-2]
+ioengine=e4defrag
+iodepth=1
+bs=128k
+donorname=test3.def
+filename=test32
+inplace=0
+rw=write
+numjobs=${LOAD_FACTOR}
+runtime=30*${TIME_FACTOR}
+time_based
+
+[aio-dio-verifier-1]
+ioengine=libaio
+iodepth=128*${LOAD_FACTOR}
+numjobs=1
+verify=crc32c-intel
+verify_fatal=1
+verify_dump=1
+verify_backlog=1024
+verify_async=1
+verifysort=1
+direct=1
+bs=64k
+rw=write
+filename=test31
+runtime=30*${TIME_FACTOR}
+time_based
+
+[aio-buffer-verifier-2]
+ioengine=libaio
+numjobs=1
+verify=crc32c-intel
+verify_fatal=1
+verify_dump=1
+verify_backlog=1024
+verify_async=1
+verifysort=1
+buffered=1
+bs=64k
+rw=randrw
+filename=test32
+runtime=30*${TIME_FACTOR}
+time_based
+
+EOF
+
+_workout()
+{
+       echo ""
+       echo " Start defragment activity"
+       echo ""
+       cat $tmp-$seq.fio >>  $seq.full
+       run_check $FIO_PROG $tmp-$seq.fio
+}
+
+_require_fio $tmp-$seq.fio
+
+_scratch_mkfs  >> $seq.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+       umount $SCRATCH_DEV 2>/dev/null
+       exit
+fi
+
+if ! _scratch_unmount; then
+       echo "failed to umount"
+       status=1
+       exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/tests/ext4/303.out b/tests/ext4/303.out
new file mode 100644 (file)
index 0000000..a7a2e67
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 303
+
+ Start defragment activity
+
diff --git a/tests/ext4/304 b/tests/ext4/304
new file mode 100644 (file)
index 0000000..f9b3721
--- /dev/null
@@ -0,0 +1,128 @@
+#! /bin/bash
+# FSQA Test No. 304
+#
+# Ext4 defragmentation stress test
+# Several threads perform defragmentation at random position
+# using 'inplace' mode (allocate and free blocks inside defrag event)
+# which significantly improve load pressure on block allocator.
+#-----------------------------------------------------------------------
+# (c) 2013 Dmitry Monakhov
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.defrag
+
+# real QA test starts here
+_supported_os Linux
+_supported_fs ext4
+_need_to_be_root
+_require_scratch
+_require_defrag
+
+BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
+# We need space for 2 files (test file, and donor one)
+# reserve 30% in order to avoid ENOSPC
+FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
+
+cat >$tmp-$seq.fio <<EOF
+# Common e4defrag regression tests
+[global]
+ioengine=ioe_e4defrag
+iodepth=1
+directory=${SCRATCH_MNT}
+filesize=${FILE_SIZE}
+size=999G
+buffered=0
+fadvise_hint=0
+group_reporting
+
+#################################
+# Test4
+# Stress test defragmentation engine
+# Several threads perform defragmentation at random position
+# use inplace=1 will allocate and free blocks inside defrag event
+# which highly increase defragmentation
+[defrag-fuzzer]
+ioengine=e4defrag
+iodepth=1
+bs=8k
+donorname=test4.def
+filename=test4
+inplace=1
+rw=randwrite
+numjobs=4*${LOAD_FACTOR}
+runtime=30*${TIME_FACTOR}
+time_based
+
+[aio-dio-verifier]
+ioengine=libaio
+iodepth=128
+iomem_align=4k
+numjobs=1
+verify=crc32c-intel
+verify_fatal=1
+verify_dump=1
+verify_backlog=1024
+verify_async=1
+verifysort=1
+direct=1
+bs=64k
+rw=write
+filename=test4
+runtime=30*${TIME_FACTOR}
+time_based
+
+EOF
+
+_workout()
+{
+       echo ""
+       echo " Start defragment activity"
+       echo ""
+       cat $tmp-$seq.fio >>  $seq.full
+       run_check $FIO_PROG $tmp-$seq.fio
+}
+
+_require_fio $tmp-$seq.fio
+
+_scratch_mkfs  >> $seq.full 2>&1
+_scratch_mount
+
+if ! _workout; then
+       umount $SCRATCH_DEV 2>/dev/null
+       exit
+fi
+
+if ! _scratch_unmount; then
+       echo "failed to umount"
+       status=1
+       exit
+fi
+_check_scratch_fs
+status=$?
+exit
diff --git a/tests/ext4/304.out b/tests/ext4/304.out
new file mode 100644 (file)
index 0000000..c8615d6
--- /dev/null
@@ -0,0 +1,4 @@
+QA output created by 304
+
+ Start defragment activity
+
diff --git a/tests/ext4/group b/tests/ext4/group
new file mode 100644 (file)
index 0000000..6a44db3
--- /dev/null
@@ -0,0 +1,11 @@
+# QA groups control file
+# Defines test groups and nominal group owners
+# - do not start group names with a digit
+# - comment line before each group is "new" description
+#
+271 auto rw quick
+301 aio dangerous ioctl rw stress
+302 aio dangerous ioctl rw stress
+303 aio dangerous ioctl rw stress
+304 aio dangerous ioctl rw stress
+
diff --git a/tests/shared/032 b/tests/shared/032
new file mode 100755 (executable)
index 0000000..768b7f0
--- /dev/null
@@ -0,0 +1,95 @@
+#! /bin/bash
+# FS QA Test No. 032
+#
+# cross check mkfs detection of foreign filesystems
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1       # failure is the default!
+trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
+rm -f $seq.full
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# real QA test starts here
+_supported_fs xfs btrfs
+_supported_os Linux
+
+_require_scratch
+_require_no_large_scratch_dev
+
+# mkfs.btrfs did not have overwrite detection at first
+if [ "$FSTYP" == "btrfs" ]; then
+       grep -q 'force overwrite' `echo $MKFS_BTRFS_PROG | awk '{print $1}'` || \
+               _notrun "Installed mkfs.btrfs does not support -f option"
+fi
+
+echo "Silence is golden."
+for fs in `echo ${MKFS_PROG}.* | sed -e 's/.sbin.mkfs.//g'`
+do
+       preop=""        # for special input needs
+       preargs=""      # for any special pre-device options
+       postargs=""     # for any special post-device options
+
+       # minix, msdos and vfat mkfs fails for large devices, restrict to 2000 blocks
+       [ $fs = minix ] && postargs=2000
+       [ $fs = msdos ] && postargs=2000
+       [ $fs = vfat ] && postargs=2000
+       # these folks prompt before writing
+       [ $fs = jfs ] && preop="echo Y |"
+       [ $fs = gfs ] && preop="echo y |" && preargs="-p lock_nolock -j 1"
+       [ $fs = gfs2 ] && preop="echo y |" && preargs="-p lock_nolock -j 1"
+       [ $fs = reiserfs ] && preop="echo y |" && preargs="-f"
+       # cramfs mkfs requires a directory argument
+       [ $fs = cramfs ] && preargs=/proc/fs
+       [ $fs = ext2 ] && preargs="-F"
+       [ $fs = ext3 ] && preargs="-F"
+       [ $fs = ext4 ] && preargs="-F"
+       [ $fs = ext4dev ] && preargs="-F"
+
+       # overwite the first few Kb - should blow away superblocks
+       src/devzero -n 20 $SCRATCH_DEV >/dev/null
+
+       # create a filesystem of this type
+       echo "=== Creating $fs filesystem..." >>$seq.full
+       echo "    ( $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs )" >>$seq.full
+       eval $preop mkfs -t $fs $preargs $SCRATCH_DEV $postargs >>$seq.full 2>&1
+
+       if [ $? -eq 0 ] ; then
+               # next, ensure we don't overwrite it
+               echo "=== Attempting $FSTYP overwrite of $fs..." >>$seq.full
+               ${MKFS_PROG}.$FSTYP $SCRATCH_DEV >>$seq.full 2>&1
+
+               [ $? -eq 0 ] && echo "Failed - overwrote fs type ${fs}!"
+       else
+               echo "mkfs of type ${fs} failed" >>$seq.full
+       fi
+done
+
+# success, all done
+status=0
+exit
diff --git a/tests/shared/032.out b/tests/shared/032.out
new file mode 100644 (file)
index 0000000..9265732
--- /dev/null
@@ -0,0 +1,2 @@
+QA output created by 032
+Silence is golden.
diff --git a/tests/shared/051 b/tests/shared/051
new file mode 100755 (executable)
index 0000000..07d5a9b
--- /dev/null
@@ -0,0 +1,366 @@
+#! /bin/bash
+# FS QA Test No. 051
+#
+# Test out ACLs.
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
+#
+# 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`
+
+here=`pwd`
+tmp=/tmp/$$
+runas=$here/src/runas
+status=1       # FAILure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.attr
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+    [ -n "$testdir" ] && rm -rf $testdir/$seq.dir1
+    _cleanup_testdir
+}
+
+# -----
+# minimal access ACL has ACEs: USER_OBJ, GROUP_OBJ, OTHER_OBJ
+# This is set with chacl(1) and can be changed by chmod(1).
+#
+# Test that this is being set for ACL and for std unix permissions
+# Test that we can get back the same ACL.
+# Test std permissions for rwx.
+# -----
+#
+# Test out default ACLs and that the ACL is being PASSed
+# onto the children of the dir.
+#
+# -----
+# Test out access check for extended ACLs.
+# -> 3 extra ACEs: MASK, GROUP, USER
+# -> the GROUP compares with egid of process _and_ the supplementary
+#    groups (as found in /etc/group)
+#
+# Test that mask works for USER, GROUP, GROUP_OBJ
+# Test that the ACE type priority is working
+#   -> this would be done by simultaneously matching on ACEs
+#   -> interesting if it allows user to specify ACEs in any order
+#
+
+# real QA test starts here
+_supported_fs xfs udf
+_supported_os Linux
+
+[ -x $runas ] || _notrun "$runas executable not found"
+
+rm -f $seq.full
+
+_setup_testdir
+
+_need_to_be_root
+_acl_setup_ids
+_require_acls
+
+# get dir
+cd $testdir
+rm -rf $seq.dir1
+mkdir $seq.dir1
+cd $seq.dir1
+
+echo "QA output created by $seq"
+echo ""
+echo "=== Test minimal ACE ==="
+
+echo "Setup file"
+# Note: as this is a shell script,
+#       will need read and execute permission set
+#       in order to execute it.
+touch file1
+cat <<EOF >file1
+#!/bin/bash
+echo "Test was executed"
+EOF
+chmod u=rwx file1
+chmod g=rw- file1
+chmod o=r-- file1
+chown $acl1.$acl2 file1
+_acl_ls file1
+
+echo ""
+echo "--- Test get and set of ACL ---"
+echo "Note: Old interface gave an empty ACL - now output an ACL"
+chacl -l file1 | _acl_filter_id
+echo "Try using single colon separator"
+echo "Note: Old interface FAILed because of single colon - new one allows it" 
+chacl u::r--,g::rwx,o:rw- file1 2>&1
+echo "Expect to PASS" 
+chacl u::r--,g::rwx,o::rw- file1 2>&1
+chacl -l file1 | _acl_filter_id
+
+echo ""
+echo "--- Test sync of ACL with std permissions ---"
+_acl_ls file1
+chmod u+w file1
+_acl_ls file1
+chacl -l file1 | _acl_filter_id
+
+echo ""
+echo "--- Test owner permissions ---"
+chacl u::r-x,g::---,o::--- file1 2>&1
+chacl -l file1 | _acl_filter_id
+# change to owner
+echo "Expect to PASS" 
+$runas -u $acl1 -g $acl1 ./file1 2>&1
+echo "Expect to FAIL" 
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+
+echo ""
+echo "--- Test group permissions ---"
+chacl u::---,g::r-x,o::--- file1 2>&1
+chacl -l file1 | _acl_filter_id
+echo "Expect to FAIL - acl1 is owner" 
+$runas -u $acl1 -g $acl1 ./file1 2>&1
+echo "Expect to PASS - acl2 matches group" 
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+echo "Expect to PASS - acl2 matches sup group" 
+$runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1
+echo "Expect to FAIL - acl3 is not in group" 
+$runas -u $acl3 -g $acl3 ./file1 2>&1
+
+echo ""
+echo "--- Test other permissions ---"
+chacl u::---,g::---,o::r-x file1 2>&1
+chacl -l file1 | _acl_filter_id
+echo "Expect to FAIL - acl1 is owner" 
+$runas -u $acl1 -g $acl1 ./file1 2>&1
+echo "Expect to FAIL - acl2 is in group" 
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+echo "Expect to FAIL - acl2 is in sup. group" 
+$runas -u $acl2 -g $acl3 -s $acl2 ./file1 2>&1
+echo "Expect to PASS - acl3 is not owner or in group" 
+$runas -u $acl3 -g $acl3 ./file1 2>&1
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Test Extended ACLs ==="
+
+echo ""
+echo "--- Test adding a USER ACE ---"
+echo "Expect to FAIL as no MASK provided"
+chacl u::---,g::---,o::---,u:$acl2:r-x file1 2>&1 | _acl_filter_id
+echo "Ensure that ACL has not been changed"
+chacl -l file1 | _acl_filter_id
+echo "Expect to PASS - USER ACE matches user"
+chacl u::---,g::---,o::---,u:$acl2:r-x,m::rwx file1 2>&1
+chacl -l file1 | _acl_filter_id
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+echo "Expect to FAIL - USER ACE does not match user"
+$runas -u $acl3 -g $acl3 ./file1 2>&1
+
+echo ""
+echo "--- Test adding a GROUP ACE ---"
+echo "Expect to FAIL as no MASK provided"
+chacl u::---,g::---,o::---,g:$acl2:r-x file1 2>&1 | _acl_filter_id
+echo "Ensure that ACL has not been changed"
+chacl -l file1 | _acl_filter_id
+chacl u::---,g::---,o::---,g:$acl2:r-x,m::rwx file1 2>&1
+chacl -l file1 | _acl_filter_id
+echo "Expect to PASS - GROUP ACE matches group"
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+echo "Expect to PASS - GROUP ACE matches sup group"
+$runas -u $acl2 -g $acl1 -s $acl2 ./file1 2>&1
+echo "Expect to FAIL - GROUP ACE does not match group"
+$runas -u $acl3 -g $acl3 ./file1 2>&1
+
+#-------------------------------------------------------
+
+echo ""
+echo "--- Test MASK ---"
+
+# group
+chacl u::---,g::---,o::---,g:$acl2:r-x,m::-w- file1 2>&1
+chacl -l file1 | _acl_filter_id
+echo "Expect to FAIL as MASK prohibits execution"
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+
+# user
+chacl u::---,g::---,o::---,u:$acl2:r-x,m::-w- file1 2>&1
+echo "Expect to FAIL as MASK prohibits execution"
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+
+# user
+chacl u::---,g::---,o::---,u:$acl2:r-x,m::r-x file1 2>&1
+echo "Expect to PASS as MASK allows execution"
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+
+#-------------------------------------------------------
+
+echo ""
+echo "--- Test ACE priority ---"
+
+chacl o::rwx,g::rwx,u:$acl1:rwx,u::---,m::rwx file1 2>&1
+echo "Expect to FAIL as should match on owner"
+$runas -u $acl1 -g $acl2 ./file1 2>&1
+
+chacl o::---,g::---,u:$acl2:rwx,u::---,m::rwx file1 2>&1
+echo "Expect to PASS as should match on user"
+$runas -u $acl2 -g $acl2 ./file1 2>&1
+
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Test can read ACLs without access permissions ==="
+# This was a bug in kernel code where syscred wasn't being used
+# to override the capabilities
+chacl o::---,g::---,u::--- file1 2>&1
+chacl -l file1 | _acl_filter_id
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Test Default ACLs ==="
+# make test clearer by testing with and without umask
+umask 0
+
+mkdir acldir
+chacl -b "u::rwx,g::rwx,o::rwx" "u::r-x,g::r--,o::---" acldir 2>&1
+chacl -l acldir | _acl_filter_id
+cd acldir
+
+touch file2
+_acl_ls file2
+chacl -l file2 | _acl_filter_id
+
+#ensure that umask is not having an effect 
+#so set it and see
+umask 722
+touch file3
+_acl_ls file3
+chacl -l file3 | _acl_filter_id
+
+cd ..
+umask 022
+
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Removing ACLs ==="
+chacl -l file1 | _acl_filter_id
+chacl -l acldir | _acl_filter_id
+chacl -l acldir/file2 | _acl_filter_id
+echo "Remove ACLs..."
+chacl -R file1
+chacl -B acldir
+chacl -R acldir/file2
+echo "Note: Old interface would mean empty ACLs - now we show mode ACLs" 
+chacl -l file1 | _acl_filter_id
+chacl -l acldir | _acl_filter_id
+chacl -l acldir/file2 | _acl_filter_id
+
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Recursive change ACL ==="
+rm -fr root
+mkdir root
+pushd root >/dev/null
+# create an arbitrary little tree
+for i in 1 2 3 4 5 6 7 8 9 0
+do
+       mkdir -p a/$i
+       mkdir -p b/c$i/$i
+       touch a/$i/mumble
+done
+popd >/dev/null
+chown -R 12345.54321 root
+echo "Change #1..."
+$runas -u 12345 -g 54321 -- `which chacl` -r u::rwx,g::-w-,o::--x root
+find root -print | xargs chacl -l
+echo "Change #2..."
+$runas -u 12345 -g 54321 -- `which chacl` -r u::---,g::---,o::--- root
+find root -print | xargs chacl -l
+
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Test out error messages for ACL text parsing  ==="
+echo "Note: Old interface gave more informative error msgs"
+
+touch file1
+set -x
+chacl u file1
+chacl u: file1
+chacl u:rumpledumpleunknownuser file1
+chacl u:rumpledumpleunknownuser: file1
+chacl g:rumpledumpleunknowngrp file1
+chacl g:rumpledumpleunknowngrp: file1
+chacl o:user1:rwx file1
+chacl m:user1:rwx file1
+chacl a::rwx file1
+set +x
+
+#-------------------------------------------------------
+
+echo ""
+echo "=== Test out large ACLs  ==="
+touch largeaclfile
+XFS_ACL_MAX_ENTRIES=25
+num_aces_pre=`expr $XFS_ACL_MAX_ENTRIES - 1`
+num_aces_post=`expr $XFS_ACL_MAX_ENTRIES + 1`
+
+acl1=`_create_n_aces $num_aces_pre`
+acl2=`_create_n_aces $XFS_ACL_MAX_ENTRIES`
+acl3=`_create_n_aces $num_aces_post`
+acl4=`_create_n_aces 16` # Andreas G. libacl size for initial get
+acl5=`_create_n_aces 17` # 1 over A.G. libacl initial size
+
+echo "1 below xfs acl max"
+chacl $acl1 largeaclfile
+getfacl --numeric largeaclfile | _filter_aces
+
+echo "xfs acl max"
+chacl $acl2 largeaclfile
+getfacl --numeric largeaclfile | _filter_aces
+
+echo "1 above xfs acl max"
+chacl $acl3 largeaclfile
+getfacl --numeric largeaclfile | _filter_aces
+
+echo "use 16 aces"
+chacl $acl4 largeaclfile
+getfacl --numeric largeaclfile | _filter_aces
+
+echo "use 17 aces"
+chacl $acl5 largeaclfile
+getfacl --numeric largeaclfile | _filter_aces
+
+#-------------------------------------------------------
+
+# success, all done
+status=0
+exit
diff --git a/tests/shared/051.out b/tests/shared/051.out
new file mode 100644 (file)
index 0000000..a871082
--- /dev/null
@@ -0,0 +1,355 @@
+QA output created by 051
+
+=== Test minimal ACE ===
+Setup file
+-rwxrw-r-- id1 id2 file1
+
+--- Test get and set of ACL ---
+Note: Old interface gave an empty ACL - now output an ACL
+file1 [u::rwx,g::rw-,o::r--]
+Try using single colon separator
+Note: Old interface FAILed because of single colon - new one allows it
+Expect to PASS
+file1 [u::r--,g::rwx,o::rw-]
+
+--- Test sync of ACL with std permissions ---
+-r--rwxrw- id1 id2 file1
+-rw-rwxrw- id1 id2 file1
+file1 [u::rw-,g::rwx,o::rw-]
+
+--- Test owner permissions ---
+file1 [u::r-x,g::---,o::---]
+Expect to PASS
+Test was executed
+Expect to FAIL
+./file1: Permission denied
+
+--- Test group permissions ---
+file1 [u::---,g::r-x,o::---]
+Expect to FAIL - acl1 is owner
+./file1: Permission denied
+Expect to PASS - acl2 matches group
+Test was executed
+Expect to PASS - acl2 matches sup group
+Test was executed
+Expect to FAIL - acl3 is not in group
+./file1: Permission denied
+
+--- Test other permissions ---
+file1 [u::---,g::---,o::r-x]
+Expect to FAIL - acl1 is owner
+./file1: Permission denied
+Expect to FAIL - acl2 is in group
+./file1: Permission denied
+Expect to FAIL - acl2 is in sup. group
+./file1: Permission denied
+Expect to PASS - acl3 is not owner or in group
+Test was executed
+
+=== Test Extended ACLs ===
+
+--- Test adding a USER ACE ---
+Expect to FAIL as no MASK provided
+chacl: access ACL 'u::---,g::---,o::---,u:id2:r-x': Missing or wrong entry at entry 3
+Ensure that ACL has not been changed
+file1 [u::---,g::---,o::r-x]
+Expect to PASS - USER ACE matches user
+file1 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
+Test was executed
+Expect to FAIL - USER ACE does not match user
+./file1: Permission denied
+
+--- Test adding a GROUP ACE ---
+Expect to FAIL as no MASK provided
+chacl: access ACL 'u::---,g::---,o::---,g:id2:r-x': Missing or wrong entry at entry 3
+Ensure that ACL has not been changed
+file1 [u::---,u:id2:r-x,g::---,m::rwx,o::---]
+file1 [u::---,g::---,g:id2:r-x,m::rwx,o::---]
+Expect to PASS - GROUP ACE matches group
+Test was executed
+Expect to PASS - GROUP ACE matches sup group
+Test was executed
+Expect to FAIL - GROUP ACE does not match group
+./file1: Permission denied
+
+--- Test MASK ---
+file1 [u::---,g::---,g:id2:r-x,m::-w-,o::---]
+Expect to FAIL as MASK prohibits execution
+./file1: Permission denied
+Expect to FAIL as MASK prohibits execution
+./file1: Permission denied
+Expect to PASS as MASK allows execution
+Test was executed
+
+--- Test ACE priority ---
+Expect to FAIL as should match on owner
+./file1: Permission denied
+Expect to PASS as should match on user
+Test was executed
+
+=== Test can read ACLs without access permissions ===
+file1 [u::---,g::---,o::---]
+
+=== Test Default ACLs ===
+acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---]
+-r--r----- 0 0 file2
+file2 [u::r--,g::r--,o::---]
+-r--r----- 0 0 file3
+file3 [u::r--,g::r--,o::---]
+
+=== Removing ACLs ===
+file1 [u::---,g::---,o::---]
+acldir [u::rwx,g::rwx,o::rwx/u::r-x,g::r--,o::---]
+acldir/file2 [u::r--,g::r--,o::---]
+Remove ACLs...
+Note: Old interface would mean empty ACLs - now we show mode ACLs
+file1 [u::---,g::---,o::---]
+acldir [u::rwx,g::rwx,o::rwx]
+acldir/file2 [u::r--,g::r--,o::---]
+
+=== Recursive change ACL ===
+Change #1...
+root [u::rwx,g::-w-,o::--x]
+root/a [u::rwx,g::-w-,o::--x]
+root/a/1 [u::rwx,g::-w-,o::--x]
+root/a/1/mumble [u::rwx,g::-w-,o::--x]
+root/a/2 [u::rwx,g::-w-,o::--x]
+root/a/2/mumble [u::rwx,g::-w-,o::--x]
+root/a/3 [u::rwx,g::-w-,o::--x]
+root/a/3/mumble [u::rwx,g::-w-,o::--x]
+root/a/4 [u::rwx,g::-w-,o::--x]
+root/a/4/mumble [u::rwx,g::-w-,o::--x]
+root/a/5 [u::rwx,g::-w-,o::--x]
+root/a/5/mumble [u::rwx,g::-w-,o::--x]
+root/a/6 [u::rwx,g::-w-,o::--x]
+root/a/6/mumble [u::rwx,g::-w-,o::--x]
+root/a/7 [u::rwx,g::-w-,o::--x]
+root/a/7/mumble [u::rwx,g::-w-,o::--x]
+root/a/8 [u::rwx,g::-w-,o::--x]
+root/a/8/mumble [u::rwx,g::-w-,o::--x]
+root/a/9 [u::rwx,g::-w-,o::--x]
+root/a/9/mumble [u::rwx,g::-w-,o::--x]
+root/a/0 [u::rwx,g::-w-,o::--x]
+root/a/0/mumble [u::rwx,g::-w-,o::--x]
+root/b [u::rwx,g::-w-,o::--x]
+root/b/c1 [u::rwx,g::-w-,o::--x]
+root/b/c1/1 [u::rwx,g::-w-,o::--x]
+root/b/c2 [u::rwx,g::-w-,o::--x]
+root/b/c2/2 [u::rwx,g::-w-,o::--x]
+root/b/c3 [u::rwx,g::-w-,o::--x]
+root/b/c3/3 [u::rwx,g::-w-,o::--x]
+root/b/c4 [u::rwx,g::-w-,o::--x]
+root/b/c4/4 [u::rwx,g::-w-,o::--x]
+root/b/c5 [u::rwx,g::-w-,o::--x]
+root/b/c5/5 [u::rwx,g::-w-,o::--x]
+root/b/c6 [u::rwx,g::-w-,o::--x]
+root/b/c6/6 [u::rwx,g::-w-,o::--x]
+root/b/c7 [u::rwx,g::-w-,o::--x]
+root/b/c7/7 [u::rwx,g::-w-,o::--x]
+root/b/c8 [u::rwx,g::-w-,o::--x]
+root/b/c8/8 [u::rwx,g::-w-,o::--x]
+root/b/c9 [u::rwx,g::-w-,o::--x]
+root/b/c9/9 [u::rwx,g::-w-,o::--x]
+root/b/c0 [u::rwx,g::-w-,o::--x]
+root/b/c0/0 [u::rwx,g::-w-,o::--x]
+Change #2...
+root [u::---,g::---,o::---]
+root/a [u::---,g::---,o::---]
+root/a/1 [u::---,g::---,o::---]
+root/a/1/mumble [u::---,g::---,o::---]
+root/a/2 [u::---,g::---,o::---]
+root/a/2/mumble [u::---,g::---,o::---]
+root/a/3 [u::---,g::---,o::---]
+root/a/3/mumble [u::---,g::---,o::---]
+root/a/4 [u::---,g::---,o::---]
+root/a/4/mumble [u::---,g::---,o::---]
+root/a/5 [u::---,g::---,o::---]
+root/a/5/mumble [u::---,g::---,o::---]
+root/a/6 [u::---,g::---,o::---]
+root/a/6/mumble [u::---,g::---,o::---]
+root/a/7 [u::---,g::---,o::---]
+root/a/7/mumble [u::---,g::---,o::---]
+root/a/8 [u::---,g::---,o::---]
+root/a/8/mumble [u::---,g::---,o::---]
+root/a/9 [u::---,g::---,o::---]
+root/a/9/mumble [u::---,g::---,o::---]
+root/a/0 [u::---,g::---,o::---]
+root/a/0/mumble [u::---,g::---,o::---]
+root/b [u::---,g::---,o::---]
+root/b/c1 [u::---,g::---,o::---]
+root/b/c1/1 [u::---,g::---,o::---]
+root/b/c2 [u::---,g::---,o::---]
+root/b/c2/2 [u::---,g::---,o::---]
+root/b/c3 [u::---,g::---,o::---]
+root/b/c3/3 [u::---,g::---,o::---]
+root/b/c4 [u::---,g::---,o::---]
+root/b/c4/4 [u::---,g::---,o::---]
+root/b/c5 [u::---,g::---,o::---]
+root/b/c5/5 [u::---,g::---,o::---]
+root/b/c6 [u::---,g::---,o::---]
+root/b/c6/6 [u::---,g::---,o::---]
+root/b/c7 [u::---,g::---,o::---]
+root/b/c7/7 [u::---,g::---,o::---]
+root/b/c8 [u::---,g::---,o::---]
+root/b/c8/8 [u::---,g::---,o::---]
+root/b/c9 [u::---,g::---,o::---]
+root/b/c9/9 [u::---,g::---,o::---]
+root/b/c0 [u::---,g::---,o::---]
+root/b/c0/0 [u::---,g::---,o::---]
+
+=== Test out error messages for ACL text parsing  ===
+Note: Old interface gave more informative error msgs
++ chacl u file1
+chacl: u - Invalid argument
++ chacl u: file1
+chacl: u: - Invalid argument
++ chacl u:rumpledumpleunknownuser file1
+chacl: u:rumpledumpleunknownuser - Invalid argument
++ chacl u:rumpledumpleunknownuser: file1
+chacl: u:rumpledumpleunknownuser: - Invalid argument
++ chacl g:rumpledumpleunknowngrp file1
+chacl: g:rumpledumpleunknowngrp - Invalid argument
++ chacl g:rumpledumpleunknowngrp: file1
+chacl: g:rumpledumpleunknowngrp: - Invalid argument
++ chacl o:user1:rwx file1
+chacl: o:user1:rwx - Invalid argument
++ chacl m:user1:rwx file1
+chacl: m:user1:rwx - Invalid argument
++ chacl a::rwx file1
+chacl: a::rwx - Invalid argument
++ set +x
+
+=== Test out large ACLs  ===
+1 below xfs acl max
+# file: largeaclfile
+# owner: 0
+# group: 0
+user::rwx
+user:1:rwx
+user:2:rwx
+user:3:rwx
+user:4:rwx
+user:5:rwx
+user:6:rwx
+user:7:rwx
+user:8:rwx
+user:9:rwx
+user:10:rwx
+user:11:rwx
+user:12:rwx
+user:13:rwx
+user:14:rwx
+user:15:rwx
+user:16:rwx
+user:17:rwx
+user:18:rwx
+user:19:rwx
+user:20:rwx
+group::rwx
+mask::rwx
+other::rwx
+
+xfs acl max
+# file: largeaclfile
+# owner: 0
+# group: 0
+user::rwx
+user:1:rwx
+user:2:rwx
+user:3:rwx
+user:4:rwx
+user:5:rwx
+user:6:rwx
+user:7:rwx
+user:8:rwx
+user:9:rwx
+user:10:rwx
+user:11:rwx
+user:12:rwx
+user:13:rwx
+user:14:rwx
+user:15:rwx
+user:16:rwx
+user:17:rwx
+user:18:rwx
+user:19:rwx
+user:20:rwx
+user:21:rwx
+group::rwx
+mask::rwx
+other::rwx
+
+1 above xfs acl max
+chacl: cannot set access acl on "largeaclfile": Invalid argument
+# file: largeaclfile
+# owner: 0
+# group: 0
+user::rwx
+user:1:rwx
+user:2:rwx
+user:3:rwx
+user:4:rwx
+user:5:rwx
+user:6:rwx
+user:7:rwx
+user:8:rwx
+user:9:rwx
+user:10:rwx
+user:11:rwx
+user:12:rwx
+user:13:rwx
+user:14:rwx
+user:15:rwx
+user:16:rwx
+user:17:rwx
+user:18:rwx
+user:19:rwx
+user:20:rwx
+user:21:rwx
+group::rwx
+mask::rwx
+other::rwx
+
+use 16 aces
+# file: largeaclfile
+# owner: 0
+# group: 0
+user::rwx
+user:1:rwx
+user:2:rwx
+user:3:rwx
+user:4:rwx
+user:5:rwx
+user:6:rwx
+user:7:rwx
+user:8:rwx
+user:9:rwx
+user:10:rwx
+user:11:rwx
+user:12:rwx
+group::rwx
+mask::rwx
+other::rwx
+
+use 17 aces
+# file: largeaclfile
+# owner: 0
+# group: 0
+user::rwx
+user:1:rwx
+user:2:rwx
+user:3:rwx
+user:4:rwx
+user:5:rwx
+user:6:rwx
+user:7:rwx
+user:8:rwx
+user:9:rwx
+user:10:rwx
+user:11:rwx
+user:12:rwx
+user:13:rwx
+group::rwx
+mask::rwx
+other::rwx
+
diff --git a/tests/shared/218 b/tests/shared/218
new file mode 100755 (executable)
index 0000000..4b46452
--- /dev/null
@@ -0,0 +1,94 @@
+#! /bin/bash
+# FS QA Test No. 218
+#
+# Basic defragmentation sanity tests
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2009 Eric Sandeen.  All Rights Reserved.
+#
+# 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`
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=tmp/$$
+status=1       # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+    _cleanup_testdir
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.defrag
+
+# real QA test starts here
+_supported_fs xfs ext4 btrfs
+_supported_os Linux
+
+_setup_testdir
+# We require scratch so that we'll have free contiguous space
+_require_scratch
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount
+
+_require_defrag
+
+fragfile=$SCRATCH_MNT/fragfile.$$
+
+rm -f $fragfile
+
+# Craft some fragmented files, defrag them, check the result.
+
+echo "zero-length file:" | tee -a $seq.full
+touch $fragfile
+_defrag $fragfile
+
+echo "Sparse file (no blocks):" | tee -a $seq.full
+xfs_io -F -f -c "truncate 1m" $fragfile
+_defrag $fragfile
+
+echo "Contiguous file:" | tee -a $seq.full
+dd if=/dev/zero of=$fragfile bs=4k count=4 &>/dev/null
+_defrag $fragfile
+
+echo "Write backwards sync, but contiguous - should defrag to 1 extent" | tee -a $seq.full
+for I in `seq 9 -1 0`; do
+       dd if=/dev/zero of=$fragfile bs=4k count=1 conv=notrunc seek=$I oflag=sync &>/dev/null
+done
+_defrag $fragfile
+
+echo "Write backwards sync leaving holes - defrag should do nothing" | tee -a $seq.full
+for I in `seq 31 -2 0`; do
+       dd if=/dev/zero of=$fragfile bs=4k count=1 conv=notrunc seek=$I oflag=sync &>/dev/null
+done
+_defrag $fragfile
+
+echo "Write forwards sync leaving holes - defrag should do nothing" | tee -a $seq.full
+for I in `seq 0 2 31`; do
+       dd if=/dev/zero of=$fragfile bs=4k count=1 conv=notrunc seek=$I oflag=sync &>/dev/null
+done
+_defrag $fragfile
+
+rm -f $seq.full
+status=0
+exit
diff --git a/tests/shared/218.out b/tests/shared/218.out
new file mode 100644 (file)
index 0000000..7559cdd
--- /dev/null
@@ -0,0 +1,19 @@
+QA output created by 218
+zero-length file:
+Before: 0
+After: 0
+Sparse file (no blocks):
+Before: 0
+After: 0
+Contiguous file:
+Before: 1
+After: 1
+Write backwards sync, but contiguous - should defrag to 1 extent
+Before: 10
+After: 1
+Write backwards sync leaving holes - defrag should do nothing
+Before: 16
+After: 16
+Write forwards sync leaving holes - defrag should do nothing
+Before: 16
+After: 16
diff --git a/tests/shared/243 b/tests/shared/243
new file mode 100755 (executable)
index 0000000..6a1b6d7
--- /dev/null
@@ -0,0 +1,179 @@
+#! /bin/bash
+# FS QA Test No. 243
+#
+# Test to ensure that the EOFBLOCK_FL gets set/unset correctly.
+#
+# As found by Theodore Ts'o:
+# If a 128K file is falloc'ed using the KEEP_SIZE flag, and then
+# write exactly 128K, the EOFBLOCK_FL doesn't get cleared correctly.
+# This is bad since it forces e2fsck to complain about that inode.
+# If you have a large number of inodes that are written with fallocate
+# using KEEP_SIZE, and then fill them up to their expected size,
+# e2fsck will potentially complain about a _huge_ number of inodes.
+# This would also cause a huge increase in the time taken by e2fsck
+# to complete its check.
+#
+# Test scenarios covered:
+# 1. Fallocating X bytes and writing Y (Y<X) (buffered and direct io)
+# 2. Fallocating X bytes and writing Y (Y=X) (buffered and direct io)
+# 3. Fallocating X bytes and writing Y (Y>X) (buffered and direct io)
+#
+# These test cases exercise the normal and edge case conditions using
+# falloc (and KEEP_SIZE).
+#
+# Ref: http://thread.gmane.org/gmane.comp.file-systems.ext4/20682
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2010 Google, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------