summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-19 06:15:56 -0700
committerSage Weil <sage@inktank.com>2013-09-19 06:15:56 -0700
commit3e328c54086cb03b1c79bc7d4f6a451815ae6bd6 (patch)
tree19337f6b2cf8815adfa312be05bbaab1f9a14f2f
parent6ca6f2f9f754031f4acdb971b71c92c9762e18c3 (diff)
downloadceph-wip-6336.tar.gz
osd: revert 'osd max xattr size' limitwip-6336
Set it to 0 (unlimited) for now. Signed-off-by: Sage Weil <sage@inktank.com>
-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 2fa72d4ce0f..dc1ac7d88c3 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -521,7 +521,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 d8aa8b1d02b..9b4d069370b 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -2898,7 +2898,8 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
case CEPH_OSD_OP_SETXATTR:
++ctx->num_write;
{
- 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 af17847aeab..4f91c5a776a 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));