generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / common / attr
index d3902346e45bae02658108249d3d06d6ed0c051b..3ebba682c894f6f85f12189f675c61c5ec24e45f 100644 (file)
@@ -26,11 +26,24 @@ _acl_get_max()
                echo 8191
                ;;
        f2fs)
-               _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
+               # If noinline_xattr is enabled, max xattr size should be:
+               # (4096 - 24) - (24 + 4) = 4044
+               # then ACL_MAX_ENTRIES should be:
+               # (4044 - (4 + 4 * 4)) / 8 + 4 = 507
+               _fs_options $TEST_DEV | grep "noinline_xattr" >/dev/null 2>&1
                if [ $? -eq 0 ]; then
-                       echo 531
+                       echo 507
                else
-                       echo 506
+                       # If inline_xattr is enabled, max xattr size should be:
+                       # (4096 - 24 + 200) - (24 + 4) = 4244
+                       # then ACL_MAX_ENTRIES should be:
+                       # (4244 - (4 + 4 * 4)) / 8 + 4 = 532
+                       _fs_options $TEST_DEV | grep "inline_xattr" >/dev/null 2>&1
+                       if [ $? -eq 0 ]; then
+                               echo 532
+                       else
+                               echo 507
+                       fi
                fi
                ;;
        bcachefs)
@@ -150,13 +163,12 @@ _require_acls()
     [ -n "$CHACL_PROG" ] || _notrun "chacl command not found"
 
     #
-    # Test if chacl is able to list ACLs on the target filesystems.  On really
-    # old kernels the system calls might not be implemented at all, but the
-    # more common case is that the tested filesystem simply doesn't support
-    # ACLs.
+    # Test if chacl is able to set an ACL on a file.  On really old kernels
+    # the system calls might not be implemented at all, but the more common
+    # case is that the tested filesystem simply doesn't support ACLs.
     #
     touch $TEST_DIR/syscalltest
-    chacl -l $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
+    chacl 'u::rw-,g::---,o::---' $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
     cat $TEST_DIR/syscalltest.out >> $seqres.full
 
     if grep -q 'Function not implemented' $TEST_DIR/syscalltest.out; then
@@ -251,41 +263,5 @@ _getfattr()
        return ${PIPESTATUS[0]}
 }
 
-# set maximum total attr space based on fs type
-case "$FSTYP" in
-xfs|udf|pvfs2|9p|ceph|nfs)
-       MAX_ATTRS=1000
-       ;;
-*)
-       # Assume max ~1 block of attrs
-       BLOCK_SIZE=`_get_block_size $TEST_DIR`
-       # user.attribute_XXX="value.XXX" is about 32 bytes; leave some overhead
-       let MAX_ATTRS=$BLOCK_SIZE/40
-esac
-
-export MAX_ATTRS
-
-# Set max attr value size based on fs type
-case "$FSTYP" in
-xfs|udf|btrfs)
-       MAX_ATTRVAL_SIZE=64
-       ;;
-pvfs2)
-       MAX_ATTRVAL_SIZE=8192
-       ;;
-9p|ceph|nfs)
-       MAX_ATTRVAL_SIZE=65536
-       ;;
-bcachefs)
-       MAX_ATTRVAL_SIZE=1024
-       ;;
-*)
-       # Assume max ~1 block of attrs
-       BLOCK_SIZE=`_get_block_size $TEST_DIR`
-       # leave a little overhead
-       let MAX_ATTRVAL_SIZE=$BLOCK_SIZE-256
-esac
-
-export MAX_ATTRVAL_SIZE
 # make sure this script returns success
 /bin/true