Merge of xfs-cmds-2.4.18:slinx:111140a by nathans.
authorNathan Scott <nathans@sgi.com>
Mon, 25 Feb 2002 22:12:17 +0000 (22:12 +0000)
committerNathan Scott <nathans@sgi.com>
Mon, 25 Feb 2002 22:12:17 +0000 (22:12 +0000)
  minor changes to xfstests as we transition to new EA/ACL interfaces.

14 files changed:
020
021
051
053
057
062
common.dump
configure.in
src/Makefile
src/acl_get.c
src/fsstress.c
tools/README.auto-qa
tools/auto-qa
tools/srcdiff

diff --git a/020 b/020
index eeec318f7625e55bb55ef45c01a3f941688b01c1..938b22b4c3cdfed06d735c1c9f0b0417812b336b 100755 (executable)
--- a/020
+++ b/020
@@ -67,50 +67,29 @@ _attr()
     return $exit
 }
 
+_getfattr()
+{
+    getfattr $* 2>$tmp.err >$tmp.out
+    exit=$?
+    _filter $tmp.out
+    _filter $tmp.err 1>&2
+    return $exit
+}
+
 _attr_list()
 {
     file=$1
     
     echo "   *** print attributes"
-    if ! _attr -l $file >$tmp.raw
+    if ! _getfattr -ad $file >$tmp.raw
     then
         echo "      !!! error return"
         return 1
     fi
-    
-    $AWK_PROG -v file=$file '
-        {
-            print substr($2,2,length($2)-2)
-            count++
-        }
-        END { 
-            exit count 
-        }
-        ' <$tmp.raw >$tmp.list
-        
-    echo "      *** $? attribute(s)"
-    for l in `cat $tmp.list`
-    do
-        if ! _attr -g $l $file >$tmp.raw
-        then
-            echo "         *** $l"
-            echo "         !!! error return"
-            return 1
-        fi
-        $AWK_PROG '
-            NR==1 {
-                print "         *** field: " substr($2,2,length($2)-2) \
-                      " length: " $5
-                next
-            }
-            {
-                print "            ::: " $0
-            }
-        ' <$tmp.raw
-        
-    done
 }
 
+[ -x /usr/bin/attr ] || _notrun "attr is not installed"
+[ -x /usr/bin/getfattr ] || _notrun "getfattr is not installed"
 
 # real QA test starts here
 
@@ -161,8 +140,8 @@ done
 
 echo "*** check"
 # don't print it all out...
-attr -l $testfile \
-    | $AWK_PROG '{ l++ } END {print "   *** " l " attribute(s)" }'
+getfattr $testfile \
+    | $AWK_PROG '{ l++ } END {print "   *** " (l - 1) " attribute(s)" }'
 
 echo "*** remove lots of attributes"
 v=0
@@ -170,7 +149,7 @@ while [ $v -lt 1000 ]
 do
     if ! attr -r "attribute_$v" $testfile >/dev/null
     then
-        echo "!!! failed to add \"attribute_$v\""
+        echo "!!! failed to remove \"attribute_$v\""
         exit 1
     fi
     
diff --git a/021 b/021
index f7586f5ac55ef63fe66e9e322f45d72fa3c406c6..2c7a9ce8ed7beea6623d9a547039d3b0b11b204a 100755 (executable)
--- a/021
+++ b/021
@@ -71,6 +71,15 @@ _attr()
     return $exit
 }
 
+_getfattr()
+{
+    getfattr $* 2>$tmp.err >$tmp.out
+    exit=$?
+    sed "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;" $tmp.out
+    sed "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g; s#$tmp[^ :]*#<TMPFILE>#g;" $tmp.err 1>&2
+    return $exit
+}
+
 # real QA test starts here
 
 _require_scratch
@@ -94,7 +103,7 @@ echo "*** make test file 1"
 touch $testfile.1
 echo "v1" | _attr -s "a1" $testfile.1 >/dev/null
 echo "v2--" | _attr -s "a2--" $testfile.1 >/dev/null
-_attr -l $testfile.1
+_getfattr -a $testfile.1
 inum_1=`ls -li $testfile.1 | $AWK_PROG '{ print $1 }'`
 
 echo "*** make test file 2"
@@ -106,7 +115,7 @@ 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
     
-_attr -l $testfile.2
+_getfattr -a $testfile.2
 inum_2=`ls -li $testfile.2 | $AWK_PROG '{ print $1 }'`
     
 echo "*** unmount FS"
diff --git a/051 b/051
index 106641cababd193dc45de6ef45ad474b0862f232..aae6458b5d11c0b05521b8058b09f19648a5fa17 100755 (executable)
--- a/051
+++ b/051
@@ -86,7 +86,7 @@ rm -f $seq.full
 _need_to_be_root
 _acl_setup_ids
 
-[ -x /bin/chacl ] || _notrun "chacl command not found"
+[ ! -x /bin/chacl -a ! -x /usr/bin/chacl ] && _notrun "chacl command not found"
 [ -x $runas ] || _notrun "$runas executable not found"
 
 # get dir
diff --git a/053 b/053
index 2cefb0d7d07e84878324ab07acb7425810d54ae0..187384f4875455d7895078b32ec8f403afb4a873 100755 (executable)
--- a/053
+++ b/053
@@ -52,6 +52,8 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
 . ./common.filter
 . ./common.attr
 
+[ ! -x /bin/chacl -a ! -x /usr/bin/chacl ] && _notrun "chacl command not found"
+
 # real QA test starts here
 _require_scratch
 _acl_setup_ids
diff --git a/057 b/057
index 76dacbae015d57bace4eb8881b9ee291a2b0fca9..13602acc5f03516f932f66011a8dbfc2fa89c759 100755 (executable)
--- a/057
+++ b/057
@@ -103,7 +103,7 @@ rm -f $seq.full
 _need_to_be_root
 
 [ -x $acl_get ] || _notrun "$acl_get command not found" 
-[ -x /bin/chacl ] || _notrun "chacl command not found"
+[ ! -x /bin/chacl -a ! -x /usr/bin/chacl ] && _notrun "chacl command not found"
 
 # get dir
 cd $TEST_DIR
diff --git a/062 b/062
index 74bffbaba5e150e4088050ab811f86673cd4b26c..50fff13b917dd0754465f0cc2ca1b8a72dd14a07 100755 (executable)
--- a/062
+++ b/062
@@ -59,6 +59,21 @@ _cleanup()
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
+_filter_scratch()
+{
+       sed -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
+}
+
+getfattr()
+{
+       /usr/bin/getfattr -adl $@ 2>&1 | _filter_scratch
+}
+
+setfattr()
+{
+       /usr/bin/setfattr $@
+}
+
 _create_test_bed()
 {
        echo "*** create test bed"
@@ -70,24 +85,10 @@ _create_test_bed()
        mknod $SCRATCH_MNT/dev/c c 0 0
        mknod $SCRATCH_MNT/dev/p p
        # sanity check
-       find $SCRATCH_MNT | LC_COLLATE=POSIX sort
-}
-
-getfattr()
-{
-       /usr/bin/getfattr $@ | sed -e \
-               "s/$SCRATCH_MNT/SCRATCH_MNT/g"
-}
-
-setfattr()
-{
-       /usr/bin/setfattr $@ | sed -e \
-               "s/$SCRATCH_MNT/SCRATCH_MNT/g"
+       find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch
 }
 
 _require_scratch
-[ -x /usr/bin/getfattr ] || _notrun "getfattr is not installed"
-[ -x /usr/bin/setfattr ] || _notrun "setfattr is not installed"
 rm -f $tmp.backup1 $tmp.backup2 $seq.full
 
 # real QA test starts here
@@ -102,7 +103,7 @@ for nsp in user xfsroot; do
 
                echo "*** set/get one initially empty attribute"
                setfattr -l -n $nsp.name $SCRATCH_MNT/$inode
-               getfattr -al -d $SCRATCH_MNT/$inode
+               getfattr -r $nsp $SCRATCH_MNT/$inode
 
                echo "*** overwrite empty, set several new attributes"
                setfattr -l -n $nsp.name -v 0xbabe $SCRATCH_MNT/$inode
@@ -110,33 +111,33 @@ for nsp in user xfsroot; do
                setfattr -l -n $nsp.name3 -v 0xdeface $SCRATCH_MNT/$inode
 
                echo "*** fetch several attribute names and values (hex)"
-               getfattr -al -d -e hex $SCRATCH_MNT/$inode
+               getfattr -r $nsp -e hex $SCRATCH_MNT/$inode
 
                echo "*** fetch several attribute names and values (base64)"
-               getfattr -al -d -e base64 $SCRATCH_MNT/$inode
+               getfattr -r $nsp -e base64 $SCRATCH_MNT/$inode
 
                echo "*** shrink value of an existing attribute"
                setfattr -l -n $nsp.name2 -v 0xdeaf $SCRATCH_MNT/$inode
-               getfattr -al -d -e hex $SCRATCH_MNT/$inode
+               getfattr -r $nsp -e hex $SCRATCH_MNT/$inode
 
                echo "*** grow value of existing attribute"
                setfattr -l -n $nsp.name2 -v 0xdecade $SCRATCH_MNT/$inode
-               getfattr -al -d -e hex $SCRATCH_MNT/$inode
+               getfattr -r $nsp -e hex $SCRATCH_MNT/$inode
 
                echo "*** set an empty value for second attribute"
                setfattr -l -n $nsp.name2 $SCRATCH_MNT/$inode
-               getfattr -al -d -n $nsp.name2 $SCRATCH_MNT/$inode
+               getfattr -r $nsp -n $nsp.name2 $SCRATCH_MNT/$inode
 
                echo "*** overwrite empty value"
                setfattr -l -n $nsp.name2 -v 0xcafe $SCRATCH_MNT/$inode
-               getfattr -al -d -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
+               getfattr -r $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
 
                echo "*** remove attribute"
                setfattr -l -x $nsp.name2 $SCRATCH_MNT/$inode
-               getfattr -al -d -n $nsp.name2 $SCRATCH_MNT/$inode
+               getfattr -r $nsp -n $nsp.name2 $SCRATCH_MNT/$inode
 
                echo "*** final list (strings, type=$inode, nsp=$nsp)"
-               getfattr -als -d $SCRATCH_MNT/$inode
+               getfattr -r '^user|^xfsroot' $SCRATCH_MNT/$inode
        done
 done
 
@@ -159,26 +160,26 @@ _extend_test_bed()
        # 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
-       find $SCRATCH_MNT | LC_COLLATE=POSIX sort
+       find $SCRATCH_MNT | LC_COLLATE=POSIX sort | _filter_scratch
 }
 
 _extend_test_bed
 
 echo
 echo "*** forward directory descent with us following symlinks"
-getfattr -L -R -adls -e hex $SCRATCH_MNT
+getfattr -L -R -r '^user|^xfsroot' -e hex $SCRATCH_MNT
 
 echo
 echo "*** reverse directory descent with us following symlinks"
-getfattr -L -R -5 -adls -e hex $SCRATCH_MNT
+getfattr -L -R -5 -r '^user|^xfsroot' -e hex $SCRATCH_MNT
 
 echo
 echo "*** forward directory descent without following symlinks"
-getfattr -P -R -adls -e hex $SCRATCH_MNT
+getfattr -P -R -r '^user|^xfsroot' -e hex $SCRATCH_MNT
 
 echo
 echo "*** reverse directory descent without following symlinks"
-getfattr -P -R -5 -adls -e hex $SCRATCH_MNT
+getfattr -P -R -5 -r '^user|^xfsroot' -e hex $SCRATCH_MNT
 
 
 # 
@@ -188,7 +189,8 @@ echo; echo
 
 _backup()
 {
-       getfattr -a -sdlR $SCRATCH_MNT >$1
+       # NB: no filtering of scratch here... (need to restore too)
+       /usr/bin/getfattr -adl -sR $SCRATCH_MNT >$1
        echo BACKUP $1 >>$seq.full
        cat $1 >> $seq.full
        [ ! -s $1 ] && echo "warning: $1 (backup file) is empty"
@@ -200,7 +202,7 @@ _backup $tmp.backup1
 echo "*** clear out the scratch device"
 rm -fr $SCRATCH_MNT/*
 echo "AFTER REMOVE" >>$seq.full
-getfattr -L -R -adls $SCRATCH_MNT >>$seq.full
+getfattr -L -R -r '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
 
 echo "*** reset test bed with no extended attributes"
 _create_test_bed
@@ -211,7 +213,7 @@ setfattr -lB $tmp.backup1
 _backup $tmp.backup2
 
 echo "AFTER RESTORE" >>$seq.full
-getfattr -L -R -adls $SCRATCH_MNT >>$seq.full
+getfattr -L -R -r '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
 
 echo "*** compare before and after backups"
 diff $tmp.backup1 $tmp.backup2
index 7f96411ac6b69f66942b9d874fe587b80f602cfc..b878755cc1cf762d9cdceaf2e9a4d74551fb70a9 100644 (file)
@@ -1146,9 +1146,16 @@ _get_eas_on_path()
 {
     _path=$1
 
-    find $_path -exec attr -l {} \; |\
-    awk '{print $9, $2}' |\
-    sed 's/["]//g' |\
+# Tim - this is the IRIX way...
+    # find $_path -exec attr -l {} \; |\
+    # awk '{print $9, $2}' |\
+    # sed 's/["]//g' |\
+    # sort |\
+# and this is now the Linux way...
+    getfattr -Rla $_path |\
+    perl -wn -e '
+       if (m/^# file: (\S+)/) { $file = $1 }
+       elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
     sort |\
     while read file ea_name; do
        attr -g $ea_name $file
index a7d64da1d8deb4865d89a440773f86e2c5b4ce1e..50a593eafded8364e9cb36c1828f8139a3960253 100644 (file)
@@ -152,14 +152,14 @@ AC_SUBST(libxfs)
 AC_SUBST(libhdl)
 
 dnl Checks for Extended Attributes header and library.
-AC_CHECK_HEADER(attr/attributes.h,, [
+AC_CHECK_HEADER(attr/xattr.h,, [
        echo
        echo 'FATAL ERROR: could not find a valid Extended Attributes header.'
        echo 'Install either the attr-devel (rpm) or the attr-dev (deb) package.'
        echo 'Alternatively, run "make install-dev" from the attr source.'
        exit 1
 ])
-AC_CHECK_LIB(attr, attr_get,, [
+AC_CHECK_LIB(attr, getxattr,, [
        echo
        echo 'FATAL ERROR: could not find a valid Extended Attributes library.'
        echo 'Install either the attr-devel (rpm) or the attr-dev (deb) package.'
@@ -169,19 +169,26 @@ AC_CHECK_LIB(attr, attr_get,, [
 libattr="-lattr"
 AC_SUBST(libattr)
 
-dnl Checks for Access Control List header and library.
+dnl Checks for Access Control List headers and library.
 AC_CHECK_HEADER(sys/acl.h,, [
        echo
-       echo 'FATAL ERROR: could not find a valid Access Control List header.'
-       echo 'Install either the acl-devel (rpm) or the acl-dev (deb) package.'
-       echo 'Alternatively, run "make install-dev" from the acl source.'
+       echo 'FATAL ERROR: could not find a valid Access Control List headers.'
+       echo 'Install either the acl-devel (rpm) or the acl (deb) package.'
+       echo 'Alternatively, run "make install" from the acl source.'
+       exit 1
+])
+AC_CHECK_HEADER(acl/libacl.h,, [
+       echo
+       echo 'FATAL ERROR: could not find a valid Access Control List headers.'
+       echo 'Install either the acl-devel (rpm) or the acl (deb) package.'
+       echo 'Alternatively, run "make install" from the acl source.'
        exit 1
 ])
 AC_CHECK_LIB(acl, acl_init,, [
        echo
        echo 'FATAL ERROR: could not find a valid Access Control List library.'
-       echo 'Install either the acl-devel (rpm) or the acl-dev (deb) package.'
-       echo 'Alternatively, run "make install-dev" from the acl source.'
+       echo 'Install either the acl-devel (rpm) or the acl (deb) package.'
+       echo 'Alternatively, run "make install" from the acl source.'
        exit 1
 ])
 libacl="-lacl"
index fdd1b398745f3f338a4b39c78204eb3642fb89a9..38ac4b7d3938227b867812dc498659d055cc40f6 100644 (file)
@@ -33,7 +33,7 @@
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
-TARGETS = alloc acl_get acl_test bstat devzero dirstress fault feature \
+TARGETS = alloc acl_get bstat devzero dirstress fault feature \
           fsstress fill fill2 holes ioctl loggen lstat64 nametest permname \
          randholes runas truncfile usemem
 ifeq ($(HAVE_DB), true)
@@ -80,10 +80,6 @@ LOGGEN_OBJECTS = loggen.o $(LIBXFS)
 loggen:                $(HFILES) $(LOGGEN_OBJECTS)
                $(CCF) -o $@ $(LDFLAGS) $(LOGGEN_OBJECTS) $(LDLIBS)
 
-ACLGET_OBJECTS = acl_get.o $(LIBACL)   
+ACLGET_OBJECTS = acl_get.o $(LIBACL) $(LIBATTR)
 acl_get:       $(HFILES) $(ACLGET_OBJECTS)
                $(CCF) -o $@ $(LDFLAGS) $(ACLGET_OBJECTS) $(LDLIBS)
-
-ACLTEST_OBJECTS = acl_test.o $(LIBACL) 
-acl_test:      $(HFILES) $(ACLTEST_OBJECTS)
-               $(CCF) -o $@ $(LDFLAGS) $(ACLTEST_OBJECTS) $(LDLIBS)
index 852705eb8c60b7ba223ab361cffd152c0402c97a..f39fe1b20f75efc6c7c4b14ad4ad6fdcdc412f8c 100644 (file)
@@ -44,6 +44,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/acl.h>
+#include <acl/libacl.h>
 
 char *prog;
 
@@ -54,7 +55,6 @@ void usage(void)
            "    -a - get access ACL\n"
            "    -d - get default ACL\n" 
            "    -f - get access ACL using file descriptor\n" 
-           "    -i - use irix semantics\n" 
            ,prog);
            
 }
@@ -68,15 +68,13 @@ main(int argc, char **argv)
         char *file;
        int getaccess = 0;
        int getdefault = 0;
-       int irixsemantics = 0;
        int usefd = 0;
        int fd = -1;
        acl_t acl;
-       char *buf_acl;
 
         prog = basename(argv[0]);
 
-       while ((c = getopt(argc, argv, "adif")) != -1) {
+       while ((c = getopt(argc, argv, "adf")) != -1) {
                switch (c) {
                case 'a':
                        getaccess = 1;
@@ -84,9 +82,6 @@ main(int argc, char **argv)
                case 'd':
                        getdefault = 1;
                        break;
-               case 'i':
-                       irixsemantics = 1;
-                       break;
                case 'f':
                        usefd = 1;
                        break;
@@ -110,10 +105,6 @@ main(int argc, char **argv)
            file = argv[optind];
        } 
 
-       if (irixsemantics) {
-           acl_set_compat(ACL_COMPAT_IRIXGET);
-       }
-
        if (usefd) {
            fd = open(file, O_RDONLY);
            if (fd < 0) {
@@ -137,21 +128,9 @@ main(int argc, char **argv)
                             prog, file, strerror(errno));
                return 0;
            }
-           if (irixsemantics && acl->acl_cnt == ACL_NOT_PRESENT) {
-               buf_acl = strdup("irix-empty");
-           }
-           else {      
-               buf_acl = acl_to_short_text (acl, (ssize_t *) NULL);
-               if (buf_acl == NULL) {
-                   fprintf (stderr, "%s: error converting ACL to short text "
-                                    "for file \"%s\": %s\n",
-                                prog, file, strerror(errno));
-                   return 0;
-               }
-           }
-           printf("%s: access %s\n", file, buf_acl);
+           printf("%s: access ", file);
+           acl_print(stdout, acl, NULL, TEXT_ABBREVIATE||TEXT_NO_ENDOFLINE);
            acl_free(acl);
-           acl_free(buf_acl);  
        }
 
         if (getdefault) {
@@ -161,24 +140,9 @@ main(int argc, char **argv)
                             prog, file, strerror(errno));
                return 0;
            }
-           if (irixsemantics && acl->acl_cnt == ACL_NOT_PRESENT) {
-               buf_acl = strdup("irix-empty");
-           }
-           else if (!irixsemantics && acl->acl_cnt == 0) {
-               buf_acl = strdup("linux-empty");
-           }
-           else {      
-               buf_acl = acl_to_short_text (acl, (ssize_t *) NULL);
-               if (buf_acl == NULL) {
-                   fprintf (stderr, "%s: error converting ACL to short text "
-                                    "for file \"%s\": %s\n",
-                                prog, file, strerror(errno));
-                   return 0;
-               }
-           }
-           printf("%s: default %s\n", file, buf_acl);
+           printf("%s: default ", file);
+           acl_print(stdout, acl, NULL, TEXT_ABBREVIATE||TEXT_NO_ENDOFLINE);
            acl_free(acl);
-           acl_free(buf_acl);
        }
 
        return 0;
index de7b0c65344b4695d42dd4799a8576e0ee286869..7b31f667288c1d0ccc69c577e107676fdd4374d5 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include "global.h"
+#include <attr/xattr.h>
 
 #define XFS_ERRTAG_MAX         17
 
@@ -206,8 +207,7 @@ int         verbose = 0;
 
 void   add_to_flist(int, int, int);
 void   append_pathname(pathname_t *, char *);
-int    attr_list_path(pathname_t *, char *, const int, int,
-                      attrlist_cursor_t *);
+int    attr_list_path(pathname_t *, char *, const int, int);
 int    attr_remove_path(pathname_t *, const char *, int);
 int    attr_set_path(pathname_t *, const char *, const char *, const int, int);
 void   check_cwd(void);
@@ -454,20 +454,22 @@ append_pathname(pathname_t *name, char *str)
 }
 
 int
-attr_list_path(pathname_t *name, char *buffer, const int buffersize, int flags,
-              attrlist_cursor_t *cursor)
+attr_list_path(pathname_t *name, char *buffer, const int buffersize, int flags)
 {
        char            buf[MAXNAMELEN];
        pathname_t      newname;
        int             rval;
 
-       rval = attr_list(name->path, buffer, buffersize, flags, cursor);
+       if (flags != ATTR_DONTFOLLOW) {
+               errno = EINVAL;
+               return -1;
+       }
+       rval = llistxattr(name->path, buffer, buffersize);
        if (rval >= 0 || errno != ENAMETOOLONG)
                return rval;
        separate_pathname(name, buf, &newname);
        if (chdir(buf) == 0) {
-               rval = attr_list_path(&newname, buffer, buffersize, flags,
-                       cursor);
+               rval = attr_list_path(&newname, buffer, buffersize, flags);
                chdir("..");
        }
        free_pathname(&newname);
@@ -1349,11 +1351,8 @@ allocsp_f(int opno, long r)
 void
 attr_remove_f(int opno, long r)
 {
-       attrlist_ent_t          *aep;
-       attrlist_t              *alist;
-       char                    *aname;
+       char                    *aname, *l;
        char                    buf[4096];
-       attrlist_cursor_t       cursor;
        int                     e;
        int                     ent;
        pathname_t              f;
@@ -1365,16 +1364,13 @@ attr_remove_f(int opno, long r)
        if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v))
                append_pathname(&f, ".");
        total = 0;
-       bzero(&cursor, sizeof(cursor));
-       do {
-               e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW,
-                       &cursor);
-               check_cwd();
-               if (e)
-                       break;
-               alist = (attrlist_t *)buf;
-               total += alist->al_count;
-       } while (alist->al_more);
+       e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW);
+       check_cwd();
+       if (e > 0) {
+               for (l = buf; l - buf <= e; l += strlen(l)+1)
+                       if (strncmp(l, "user.",5) == 0)
+                               total++;
+       }
        if (total == 0) {
                if (v)
                        printf("%d/%d: attr_remove - no attrs for %s\n",
@@ -1383,24 +1379,20 @@ attr_remove_f(int opno, long r)
                return;
        }
        which = (int)(random() % total);
-       bzero(&cursor, sizeof(cursor));
        ent = 0;
        aname = NULL;
-       do {
-               e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW,
-                       &cursor);
-               check_cwd();
-               if (e)
-                       break;
-               alist = (attrlist_t *)buf;
-               if (which < ent + alist->al_count) {
-                       aep = (attrlist_ent_t *)
-                               &buf[alist->al_offset[which - ent]];
-                       aname = aep->a_name;
-                       break;
+       e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW);
+       check_cwd();
+       if (e <= 0)
+               return;
+       for (l = buf; l - buf <= e; l += strlen(l)+1) {
+               if (strncmp(l, "user.",5) == 0) {
+                       if (++ent == which) {
+                               aname = l;
+                               break;
+                       }
                }
-               ent += alist->al_count;
-       } while (alist->al_more);
+       }
        if (aname == NULL) {
                if (v)
                        printf(
index 2e237100c5834d940331e8fa4e62c742820bff40..46eb35b3cccf851eb5c2f8b32e0764c260f48883 100644 (file)
@@ -15,6 +15,8 @@ ______________________                                      ______________
                so it can update itself)
        - copy an appropriate .config file to
                $HOME/qa/$HOSTNAME.config
+       - You'll need to maunally install the "quota" and "acl"
+         userspace tools, rest will be installed automatically.
        - You'll need a hacked version of 'su' in $HOME/qa that
                 lets your user su to root/root without a password
                 (if you want to run from cron, it mustn't require
index 2db90e1cdc5d6097918545bc0e67a8614e23a70c..5fbb677b4394afc99c79c2b538843d60fabdcdd0 100755 (executable)
@@ -333,7 +333,7 @@ do
 
         *clean)
             # we need to configure or else we might fail to clean
-            for pkg in attr acl xfsprogs dmapi xfsdump xfstests
+            for pkg in attr xfsprogs dmapi xfsdump xfstests
            do
                 cd $WORKAREA/cmd/$pkg
                 _log "        *** clean $pkg tools"
@@ -386,7 +386,7 @@ do
                         || _fail "            !!! build modules failed"
                                     
             _log "        *** build and install tools"
-            for pkg in attr acl xfsprogs dmapi xfsdump xfstests 
+            for pkg in attr xfsprogs dmapi xfsdump xfstests 
             do
                 cd $WORKAREA/cmd/$pkg
 
index 4e55c79e15aa8ff91caada3b4bc80c51af21cd06..ac61593e752cf2899a12cfa0ade8a874bfb2145b 100755 (executable)
@@ -78,8 +78,6 @@ foreach (@difflist) {
 }
 straightdiff 'xfs_cred.h', 'cmd/xfsprogs/include', 'linux/fs/xfs/linux';
 straightdiff 'xfs_fs.h', 'cmd/xfsprogs/include', 'linux/include/linux';
-straightdiff 'attr_kern.h', 'cmd/attr/include', 'linux/fs/xfs/linux';
-straightdiff 'attributes.h', 'cmd/attr/include', 'linux/include/linux';
 straightdiff 'dmapi_kern.h', 'cmd/dmapi/include', 'linux/include/linux';
 straightdiff 'dmapi.h', 'cmd/dmapi/include', 'linux/include/linux';
 straightdiff 'arch.h', 'cmd/xfsprogs/include', 'linux/include/linux/xfs_support';