mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
attr: add support for cephfs
Block size for cephfs is 4M, which makes generic/020 test fail as the value for MAX_ATTRS and MAX_ATTRVAL_SIZE will be too high. Restrict these two variables to sane values for this FSTYP. Signed-off-by: Luis Henriques <lhenriques@suse.com> Reviewed-by: "Yan, Zheng" <ukernel@gmail.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
committed by
Eryu Guan
parent
3c309f26fb
commit
5fcc706aab
+17
-7
@@ -254,26 +254,36 @@ _sort_getfattr_output()
|
||||
}
|
||||
|
||||
# set maximum total attr space based on fs type
|
||||
if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" -o "$FSTYP" == "pvfs2" ]; then
|
||||
case "$FSTYP" in
|
||||
xfs|udf|pvfs2|ceph)
|
||||
MAX_ATTRS=1000
|
||||
else # Assume max ~1 block of attrs
|
||||
;;
|
||||
*)
|
||||
# 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
|
||||
fi
|
||||
esac
|
||||
|
||||
export MAX_ATTRS
|
||||
|
||||
# Set max attr value size based on fs type
|
||||
if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" -o "$FSTYP" == "btrfs" ]; then
|
||||
case "$FSTYP" in
|
||||
xfs|udf|btrfs)
|
||||
MAX_ATTRVAL_SIZE=64
|
||||
elif [ "$FSTYP" == "pvfs2" ]; then
|
||||
;;
|
||||
pvfs2)
|
||||
MAX_ATTRVAL_SIZE=8192
|
||||
else # Assume max ~1 block of attrs
|
||||
;;
|
||||
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
|
||||
fi
|
||||
esac
|
||||
|
||||
export MAX_ATTRVAL_SIZE
|
||||
# make sure this script returns success
|
||||
|
||||
Reference in New Issue
Block a user