summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-23 16:23:33 -0700
committerSage Weil <sage@inktank.com>2013-09-23 16:24:25 -0700
commit2908225092bd2aa1b8afcb7848c1cdac5bd9e638 (patch)
treec03610fd045e024a836242bcba7daf6f76084eb1
parentb3d3b3747c1eef695138dac828e5fcb435309c7b (diff)
downloadceph-2908225092bd2aa1b8afcb7848c1cdac5bd9e638.tar.gz
osd: revert 'osd max xattr size' limit
Set it to 0 (unlimited) for now. Backport: dumpling Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Yehuda Sadeh <yehuda@inktank.com> (cherry picked from commit abb88d70643c3a76435b7a9d5b04ff29f7502361)
-rw-r--r--src/common/config_opts.h2
-rw-r--r--src/osd/ReplicatedPG.cc3
-rw-r--r--src/test/librados/misc.cc24
3 files changed, 17 insertions, 12 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index ad5051443c7..91e82346b0c 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -505,7 +505,7 @@ OPTION(osd_recovery_op_warn_multiple, OPT_U32, 16)
OPTION(osd_mon_shutdown_timeout, OPT_DOUBLE, 5)
OPTION(osd_max_object_size, OPT_U64, 100*1024L*1024L*1024L) // OSD's maximum object size
-OPTION(osd_max_attr_size, OPT_U64, 65536)
+OPTION(osd_max_attr_size, OPT_U64, 0)
OPTION(filestore, OPT_BOOL, false)
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc
index ab9c8099a44..90d3e1d1f31 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -2852,7 +2852,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
case CEPH_OSD_OP_SETXATTR:
{
- if (op.xattr.value_len > g_conf->osd_max_attr_size) {
+ if (g_conf->osd_max_attr_size > 0 &&
+ op.xattr.value_len > g_conf->osd_max_attr_size) {
result = -EFBIG;
break;
}
diff --git a/src/test/librados/misc.cc b/src/test/librados/misc.cc
index 6cb7cf5452a..c37e5759a69 100644
--- a/src/test/librados/misc.cc
+++ b/src/test/librados/misc.cc
@@ -538,21 +538,25 @@ TEST(LibRadosMisc, BigAttrPP) {
bufferlist got;
- bl.clear();
- got.clear();
- bl.append(buffer::create(g_conf->osd_max_attr_size));
- ASSERT_EQ(0, ioctx.setxattr("foo", "one", bl));
- ASSERT_EQ((int)bl.length(), ioctx.getxattr("foo", "one", got));
- ASSERT_TRUE(bl.contents_equal(got));
+ if (g_conf->osd_max_attr_size) {
+ bl.clear();
+ got.clear();
+ bl.append(buffer::create(g_conf->osd_max_attr_size));
+ ASSERT_EQ(0, ioctx.setxattr("foo", "one", bl));
+ ASSERT_EQ((int)bl.length(), ioctx.getxattr("foo", "one", got));
+ ASSERT_TRUE(bl.contents_equal(got));
- bl.clear();
- bl.append(buffer::create(g_conf->osd_max_attr_size+1));
- ASSERT_EQ(-EFBIG, ioctx.setxattr("foo", "one", bl));
+ bl.clear();
+ bl.append(buffer::create(g_conf->osd_max_attr_size+1));
+ ASSERT_EQ(-EFBIG, ioctx.setxattr("foo", "one", bl));
+ } else {
+ cout << "osd_max_attr_size == 0; skipping test" << std::endl;
+ }
for (int i=0; i<1000; i++) {
bl.clear();
got.clear();
- bl.append(buffer::create(g_conf->osd_max_attr_size));
+ bl.append(buffer::create(MIN(g_conf->osd_max_attr_size, 1024)));
char n[10];
snprintf(n, sizeof(n), "a%d", i);
ASSERT_EQ(0, ioctx.setxattr("foo", n, bl));