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)
+ echo 251
+ ;;
*)
echo 0
;;
j=1
for(i=1; i<1000000 && j<=3;i++){
if (! (i in ids)) {
- printf "acl%d=%d;", j, i;
+ printf "acl%d=%d;", j, i;
j++
}
- }
+ }
}'`
}
_acl_ls()
{
_ls_l -n $* | awk '{ print $1, $3, $4, $NF }' | _acl_filter_id
-}
+}
# create an ACL with n ACEs in it
#
BEGIN {
FS=":"
while ( getline <tmpfile > 0 ) {
- idlist[$1] = $3
+ idlist[$1] = $3
}
}
/^user/ { if ($2 in idlist) sub($2, idlist[$2]); print; next}
[ -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
{
local args
local nsp
-
+
if [ $# -eq 0 ]; then
args="user"
else
args="$*"
fi
-
+
[ -n "$ATTR_PROG" ] || _notrun "attr command not found"
[ -n "$GETFATTR_PROG" ] || _notrun "getfattr command not found"
[ -n "$SETFATTR_PROG" ] || _notrun "setfattr command not found"
-
+
for nsp in $args; do
#
# Test if chacl is able to write an attribute on the target
touch $TEST_DIR/syscalltest
$SETFATTR_PROG -n "$nsp.xfstests" -v "attr" $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
_notrun "kernel does not support attrs"
fi
if grep -q 'Operation not supported' $TEST_DIR/syscalltest.out; then
_notrun "attr namespace $nsp not supported by this filesystem type: $FSTYP"
fi
-
+
rm -f $TEST_DIR/syscalltest.out
done
}
return ${PIPESTATUS[0]}
}
-# set maximum total attr space based on fs type
-case "$FSTYP" in
-xfs|udf|pvfs2|9p|ceph)
- 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)
- MAX_ATTRVAL_SIZE=65536
- ;;
-*)
- # 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