Skip to contentSkip to conversation

fstests: attr: add support for cephfs

PATCH In review Luis Henriques 3 participants 6 messages May 3, 2017 – May 4, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fstests: 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.

---
 common/attr | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
common/attr +17 -7
index ac139e618b2a..c840ce42a1fa 100644
@@ -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
#1 lore raw
Quoted 5 lines · Luis Henriques

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.

Thanks for the patch! I'd like some reviews from ceph developers on the ceph MAX_ATTRS and MAX_ATTRVAL_SIZE numbers.

Thanks,
Eryu

Quoted 56 lines
---
 common/attr | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
common/attr +17 -8
index ac139e618b2a..c840ce42a1fa 100644
@@ -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
--

To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 10 lines · Eryu Guan
Quoted 5 lines · Luis Henriques

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.

Thanks for the patch! I'd like some reviews from ceph developers on the ceph MAX_ATTRS and MAX_ATTRVAL_SIZE numbers.

Currently we don't have any limitation on single xattr size and number of xattrs. But single xattr size is limited to 65536 by kernel.

Regards
Yan, Zheng

Quoted 63 lines

Thanks,
Eryu

Quoted 53 lines
---
 common/attr | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
common/attr +17 -8
index ac139e618b2a..c840ce42a1fa 100644
@@ -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
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 6 lines · Zheng
Quoted 5 lines · Eryu Guan
Quoted 4 lines · Luis Henriques

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thanks for the patch! I'd like some reviews from ceph developers on the ceph MAX_ATTRS and MAX_ATTRVAL_SIZE numbers.

Currently we don't have any limitation on single xattr size and number of xattrs. But single xattr size is limited to 65536 by kernel.

Thanks! Can I take it as a Reviewed-by tag?

Eryu

A message that is not in the archive (sent off-list or not yet received): CAAM7YA=rCf_y1r8+SwWL9rpjEnFrfBg5Y6oQMqokXuH7-PPHsw@mail.gmail.com

#5 lore raw

[cc'ed fstests list]

Quoted 14 lines · Zheng
Quoted 13 lines · Eryu Guan
Quoted 12 lines · Zheng
Quoted 10 lines · Eryu Guan
Quoted 5 lines · Luis Henriques

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.

Thanks for the patch! I'd like some reviews from ceph developers on the ceph MAX_ATTRS and MAX_ATTRVAL_SIZE numbers.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Currently we don't have any limitation on single xattr size and number of xattrs. But single xattr size is limited to 65536 by kernel.

Thanks! Can I take it as a Reviewed-by tag?

yes

Thanks!

Eryu

#6 lore raw
In reply to Yan, Zheng
Quoted 6 lines · Zheng
Quoted 5 lines · Eryu Guan
Quoted 4 lines · Luis Henriques

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.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Thanks for the patch! I'd like some reviews from ceph developers on the ceph MAX_ATTRS and MAX_ATTRVAL_SIZE numbers.

Currently we don't have any limitation on single xattr size and number of xattrs. But single xattr size is limited to 65536 by kernel.

Right, and the same limit is also applied when trying to list (listxattr) more than XATTR_LIST_MAX bytes. One of the failures in the generic/020 test was because it was getting a -E2BIG in getfattr.

Cheers,
--
Luís

Quoted 68 lines

Regards
Yan, Zheng

Quoted 63 lines

Thanks,
Eryu

Quoted 53 lines
---
 common/attr | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)
common/attr +17 -8
index ac139e618b2a..c840ce42a1fa 100644
@@ -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
--
Quoted 3 lines

To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html