public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Luis Henriques <lhenriques@suse.com>
To: fstests@vger.kernel.org
Cc: ceph-devel@vger.kernel.org, Luis Henriques <lhenriques@suse.com>
Subject: [PATCH] fstests: attr: add support for cephfs
Date: Wed,  3 May 2017 11:54:13 +0100	[thread overview]
Message-ID: <20170503105413.8314-1-lhenriques@suse.com> (raw)

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>
---
 common/attr | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/common/attr b/common/attr
index ac139e618b2a..c840ce42a1fa 100644
--- a/common/attr
+++ b/common/attr
@@ -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

             reply	other threads:[~2017-05-03 10:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 10:54 Luis Henriques [this message]
2017-05-04  3:23 ` [PATCH] fstests: attr: add support for cephfs Eryu Guan
2017-05-04  3:44   ` Yan, Zheng
2017-05-04  5:00     ` Eryu Guan
     [not found]       ` <CAAM7YA=rCf_y1r8+SwWL9rpjEnFrfBg5Y6oQMqokXuH7-PPHsw@mail.gmail.com>
2017-05-04  7:57         ` Eryu Guan
2017-05-04  9:29     ` Luis Henriques

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170503105413.8314-1-lhenriques@suse.com \
    --to=lhenriques@suse.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox