From 54a448db29dca96aa18dc8c94f5dc74e43efb843 Mon Sep 17 00:00:00 2001 From: fsgqa Date: Mon, 25 Feb 2002 22:33:42 +0000 Subject: [PATCH] Merge of xfs-cmds-2.4.18:slinx:111985a by nathans. getfattr/setfattr fixes --- 020 | 17 +++++++++++----- 020.out | 61 +++++++++++++++++++++++---------------------------------- 021 | 13 +++++++++--- 021.out | 17 +++++++++++----- 053.out | 8 ++++---- 057 | 2 ++ 062 | 4 ++-- 062.out | 8 ++------ 8 files changed, 68 insertions(+), 62 deletions(-) diff --git a/020 b/020 index 938b22b4..a5f99d01 100755 --- a/020 +++ b/020 @@ -81,7 +81,7 @@ _attr_list() file=$1 echo " *** print attributes" - if ! _getfattr -ad $file >$tmp.raw + if ! _getfattr -ad $file then echo " !!! error return" return 1 @@ -93,6 +93,8 @@ _attr_list() # real QA test starts here +rm -f $seq.full + testfile=$TEST_DIR/attribute_$$ echo "*** list non-existant file" @@ -128,7 +130,7 @@ echo "*** add lots of attributes" v=0 while [ $v -lt 1000 ] do - echo "value_$v" | attr -s "attribute_$v" $testfile >/dev/null + echo "value_$v" | attr -s "attribute_$v" $testfile >>$seq.full if [ $? -ne 0 ] then echo "!!! failed to add \"attribute_$v\"" @@ -140,14 +142,19 @@ done echo "*** check" # don't print it all out... -getfattr $testfile \ - | $AWK_PROG '{ l++ } END {print " *** " (l - 1) " attribute(s)" }' +getfattr -a $testfile \ + | tee -a $seq.full \ + | $AWK_PROG ' + /^#/ { next } + /^[ ]*$/ { next } + { l++ } + END {print " *** " (l - 1) " attribute(s)" }' echo "*** remove lots of attributes" v=0 while [ $v -lt 1000 ] do - if ! attr -r "attribute_$v" $testfile >/dev/null + if ! attr -r "attribute_$v" $testfile >>$seq.full then echo "!!! failed to remove \"attribute_$v\"" exit 1 diff --git a/020.out b/020.out index 97fd946a..ff385f4d 100644 --- a/020.out +++ b/020.out @@ -1,17 +1,12 @@ QA output created by 020 *** list non-existant file *** print attributes -attr_list: No such file or directory -Could not list attributes for +getfattr: : No such file or directory !!! error return *** list non-xfs file (in /proc) *** print attributes -attr_list: Operation not supported -Could not list attributes for - !!! error return *** list empty file *** print attributes - *** 0 attribute(s) *** query non-existant attribute attr_get: No data available Could not get "nonexistant" for @@ -20,62 +15,54 @@ Attribute "fish" set to a 5 byte value for : fish *** print attributes - *** 1 attribute(s) - *** field: fish length: 5 - ::: fish - ::: +# file: +user.fish="fish\012" + *** replace attribute Attribute "fish" set to a 6 byte value for : fish3 *** print attributes - *** 1 attribute(s) - *** field: fish length: 6 - ::: fish3 - ::: +# file: +user.fish="fish3\012" + *** add attribute Attribute "snrub" set to a 6 byte value for : fish2 *** print attributes - *** 2 attribute(s) - *** field: fish length: 6 - ::: fish3 - ::: - *** field: snrub length: 6 - ::: fish2 - ::: +# file: +user.fish="fish3\012" +user.snrub="fish2\012" + *** remove attribute *** print attributes - *** 1 attribute(s) - *** field: snrub length: 6 - ::: fish2 - ::: +# file: +user.snrub="fish2\012" + *** add lots of attributes *** check - *** 1001 attribute(s) + *** 1000 attribute(s) *** remove lots of attributes *** print attributes - *** 1 attribute(s) - *** field: snrub length: 6 - ::: fish2 - ::: +# file: +user.snrub="fish2\012" + *** really long value 0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 * 0200000 0a 0200001 *** set/get/remove really long names (expect failure) -attr_set: Bad address +attr_set: Invalid argument Could not set "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for -attr_get: Bad address +attr_get: Invalid argument Could not get "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for -attr_remove: Bad address +attr_remove: Invalid argument Could not remove "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" for *** check final *** print attributes - *** 1 attribute(s) - *** field: snrub length: 6 - ::: fish2 - ::: +# file: +user.snrub="fish2\012" + *** delete diff --git a/021 b/021 index 2c7a9ce8..f06d8286 100755 --- a/021 +++ b/021 @@ -111,11 +111,19 @@ echo "*** make test file 2" touch $testfile.2 echo "value_1" | _attr -s "a1" $testfile.2 >/dev/null echo "value_2" | _attr -s "a2-----" $testfile.2 >/dev/null - (echo start ; dd if=/dev/zero bs=65525 count=1 ; echo end ) \ | _attr -s "a3" $testfile.2 >/dev/null - _getfattr -a $testfile.2 + +# print name and size from 1st line of output +_attr -g "a3" $testfile.2 | head -1 + +# print out the rest of the data apart from the header +# the size is +1 for an extra \n at the end +echo -n "size of attr value = " +_attr -g "a3" $testfile.2 | tail -3 | wc -c +echo "" + inum_2=`ls -li $testfile.2 | $AWK_PROG '{ print $1 }'` echo "*** unmount FS" @@ -131,5 +139,4 @@ echo "*** dump attributes (2)" xfs_db -r -c "inode $inum_2" -c "a a.bmx[0].startblock" -c "print" $SCRATCH_DEV echo "*** done" -rm $seq.full exit diff --git a/021.out b/021.out index 34864b41..8a871c16 100644 --- a/021.out +++ b/021.out @@ -2,14 +2,21 @@ QA output created by 021 *** mkfs *** mount FS *** make test file 1 -Attribute "a1" has a 3 byte value for .1 -Attribute "a2--" has a 5 byte value for .1 +# file: .1 +user.a1 +user.a2-- + *** make test file 2 1+0 records in 1+0 records out -Attribute "a1" has a 8 byte value for .2 -Attribute "a3" has a 65535 byte value for .2 -Attribute "a2-----" has a 8 byte value for .2 +# file: .2 +user.a1 +user.a2----- +user.a3 + +Attribute "a3" had a 65535 byte value for .2: +size of attr value = 65536 + *** unmount FS *** dump attributes (1) a.sfattr.hdr.totsize = 24 diff --git a/053.out b/053.out index 1764d064..cd71cbba 100644 --- a/053.out +++ b/053.out @@ -7,9 +7,9 @@ $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---] $SCRATCH_MNT/test.2 [u::---,g::r-x,o::---] $SCRATCH_MNT/test.3 [u::---,g::---,o::r-x] $SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx] -$SCRATCH_MNT/test.5 [u::---,g::---,o::---,u:id2:r-x,m::rwx] +$SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---] $SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--] -$SCRATCH_MNT/test.7 [u::---,g::---,o::---,g:id2:r-x,m::-w-] +$SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---] unmount $SCRATCH_DEV... done repair filesystem... done mount filesytem... done @@ -19,6 +19,6 @@ $SCRATCH_MNT/test.1 [u::r-x,g::---,o::---] $SCRATCH_MNT/test.2 [u::---,g::r-x,o::---] $SCRATCH_MNT/test.3 [u::---,g::---,o::r-x] $SCRATCH_MNT/test.4 [u::---,g::r-x,o::rwx] -$SCRATCH_MNT/test.5 [u::---,g::---,o::---,u:id2:r-x,m::rwx] +$SCRATCH_MNT/test.5 [u::---,u:id2:r-x,g::---,m::rwx,o::---] $SCRATCH_MNT/test.6 [u::rwx,g::r-x,o::r--] -$SCRATCH_MNT/test.7 [u::---,g::---,o::---,g:id2:r-x,m::-w-] +$SCRATCH_MNT/test.7 [u::---,g::---,g:id2:r-x,m::-w-,o::---] diff --git a/057 b/057 index 13602acc..09a73d95 100755 --- a/057 +++ b/057 @@ -98,6 +98,8 @@ _acl_on() } # real QA test starts here +_notrun "irix get semantics no longer required" + rm -f $seq.full _need_to_be_root diff --git a/062 b/062 index 50fff13b..6034f45b 100755 --- a/062 +++ b/062 @@ -155,8 +155,8 @@ _extend_test_bed() mkdir -p $SCRATCH_MNT/descend/down/here find $SCRATCH_MNT/descend | xargs setfattr -n user.x -v yz find $SCRATCH_MNT/descend | xargs setfattr -n user.1 -v 23 - find $SCRATCH_MNT/here | xargs setfattr -n root.a -v bc - find $SCRATCH_MNT/here | xargs setfattr -n root.9 -v 87 + find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.a -v bc + find $SCRATCH_MNT/here | xargs setfattr -n xfsroot.9 -v 87 # whack a symlink in the middle, just to be difficult ln -s $SCRATCH_MNT/here/up $SCRATCH_MNT/descend/and # dump out our new starting point diff --git a/062.out b/062.out index bdf591cf..2a765d42 100644 --- a/062.out +++ b/062.out @@ -587,8 +587,6 @@ SCRATCH_MNT/dev/p: xfsroot.name2: No such attribute # file: SCRATCH_MNT/dev/p user.name="\272\276" user.name3="\336\372\316" - -# file: SCRATCH_MNT/dev/p xfsroot.name="\272\276" xfsroot.name3="\336\372\316" @@ -735,8 +733,8 @@ user.1=0x3233 user.x=0x797a # file: SCRATCH_MNT/descend/and/ascend -root.9=0x3837 -root.a=0x6263 +xfsroot.9=0x3837 +xfsroot.a=0x6263 # file: SCRATCH_MNT/descend user.1=0x3233 @@ -771,8 +769,6 @@ xfsroot.name3=0xdeface # file: SCRATCH_MNT/dev/p user.name=0xbabe user.name3=0xdeface - -# file: SCRATCH_MNT/dev/p xfsroot.name=0xbabe xfsroot.name3=0xdeface -- 2.39.5